Displaying 5 results from an estimated 5 matches for "dtheta".
Did you mean:
theta
2011 Jan 25
1
deSolve: Problem solving ODE including modulo-operator
...--------------------------
library(deSolve)
iterations <- 100
Parameter <- c(k = 0.6)
State <- c(Theta = 1 , P = 1)
Time <- 0:iterations/10
standardmap1 <- function(Time, State, Parameter){
with(as.list(c(State, Parameter)), {
dP <- (P + k * sin(Theta)) %% (2 * pi)
dTheta <- (P + Theta) %% (2 * pi)
return(list(c(dP, dTheta)))
})
}
#solve ode using standardmap1
out1 <- as.data.frame(ode(func = standardmap1, y = State,parms = Parameter,
times = Time))
# x mod y, end: maximal iterations
modulo <- function(x,y,end=1000){
for (n in 0:end)
if (x > (n-1...
2009 Sep 03
1
Output from as.windrose() in oce package baffles me
...library(oce)
# azimuths <- c(22.5, 45, 90, 180, 270) # 0 and 360=north, 90=east,
180=south, 270=west
angles <- c(67.5, 45, 0, 270, 180) # geometric equivalents of azimuths
radians <- angles * pi /180
x <- round(cos(radians), 6)
y <- round(sin(radians), 6)
w <- as.windrose(x, y, dtheta = 90) # make a windrose object, oce
package
# part of windrose object w:
$data$theta
[1] 90 180 270 360
$data$count
[1] 1 0 1 1
Thanks,
Scott Waichler
Pacific Northwest National Laboratory
scott.waichler at pnl.gov
2003 Mar 05
8
How to draw several plots in one figure?
Hey,
I want to draw several plots sequently, but have to make them dispaly in one
figure.
So how to achieve this?
Thanks.
Fred
2008 Sep 27
3
Double integration - Gauss Quadrature
Hi,
I would like to solve a double integral of the form
\int_0^1 \int_0^1 x*y dx dy
using Gauss Quadrature.
I know that I can use R's integrate function to calculate it:
integrate(function(y) {
sapply(y, function(y) {
integrate(function(x) x*y, 0, 1)$value
})
}, 0, 1)
but I would like to use Gauss Quadrature to do it.
I have written the following code (using R's statmod package)
2008 Oct 15
0
R-help Digest, Vol 67, Issue 31
...) / 2
x <- nodes*C1 + D1
C2*sum(weights *
sapply( y,
function(y) { C1 * sum( weights * f(x, y)) } ) )
}
# your problem: area = 0.25
gauss_legendre2D(function(x,y) {x*y}, 0.0, 1.0, 0.0, 1.0, nodes, weights)
# test: area of unit circle = integral 0..2pi integral 0..1 r*dr *dTheta
gauss_legendre2D(function(x,y) {x}, 0.0, 1.0, 0.0, 2*pi, nodes, weights)
efg
Earl F Glynn
------------------------------
Message: 81
Date: Tue, 30 Sep 2008 11:07:33 +1300
From: "Peter Alspach" <PAlspach at hortresearch.co.nz>
Subject: Re: [R] count data with a specific range
To...