MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How can I "perturbate" a NDSolve expresion?

Iván Lazaro wrote:

> Hi all!


> I'm trying to make a perturbation to a equation while NDSolve is doing his

> job.


> Suppose the equation is x'[t]=A*F(x[t]); where A is a parameter matrix, and

> x'[t] are n-dimensional variables; i need that when integration time is, for

> example, 10, the parameters change in some amount. Another posibility is

> that each time step I generate a random number, and if it is less than

> 0.001, the parameters change in some amount.


> Is it possible using NDSolve, or I have to write the integrator routine?


> Thanks!


Hi Ivan,

simply set:


a[t_] := If[RandomReal[] < 0.001, RandomReal[],

   0]; NDSolve[{x1'[t] == (Sin[t] + a[t])*x2[t],

   x2'[t] == (Cos[t] - a[t]*x1[t]^2)*x1[t], x1[0] == 1,

   x2[0] == 0}, {x1[t], x2[t]}, {t, 0, 10}]



  • Prev by Date: Re: Imposing boundary condition at infinity
  • Next by Date: Problem with a 1st order IV ODE (nonlinear)
  • Previous by thread: ::usage messages for symbols with DownValues
  • Next by thread: Problem with a 1st order IV ODE (nonlinear)