Re: Re: White Noise in Simulation
- To: mathgroup at smc.vnet.net
- Subject: [mg103627] Re: [mg103576] Re: White Noise in Simulation
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Wed, 30 Sep 2009 05:03:18 -0400 (EDT)
- References: <h9p69i$vu$1@smc.vnet.net> <200909291136.HAA25463@smc.vnet.net>
- Reply-to: drmajorbob at yahoo.com
v can't be both continuous AND white noise. The best you can do (I think)
is something like this:
sigma = 3.5;
{start, stop} = {-Pi, Pi};
n = 20;
v = Interpolation@
Table[{t, RandomReal@NormalDistribution[0, sigma]}, {t, start,
stop, (stop - start)/(n - 1)}];
Clear[x]
x = x /. First@
NDSolve[{x'[t] == x[t] + Sin[t] + v[t], x[start] == 0},
x, {t, start, stop}];
Plot[{v@t, x@t}, {t, start, stop}]
Run that code several times, and you'll see very different results.
If sigma is small, though, v will hardly matter at all.
Bobby
On Tue, 29 Sep 2009 06:36:17 -0500, SlipperyWeasel
<slipperyweasel at gmail.com> wrote:
> On Sep 27, 10:16 pm, SlipperyWeasel <slipperywea... at gmail.com> wrote:
>> I am trying to add random noise to a function inside an NDSolve
>> function. Is there a good way to add a "noise function" in my model?
>
> for example, my system is: x'[t] == x[t] + Sin[t] + v
> where v is Gaussian white noise.
>
> v has to be a continuous function of t in order to use NDSolve on the
> ODE, but it also should be uncorrelated. How can I make this a
> continuous function while still making it uncorrelated?
>
--
DrMajorBob at yahoo.com
- References:
- Re: White Noise in Simulation
- From: SlipperyWeasel <slipperyweasel@gmail.com>
- Re: White Noise in Simulation