MathGroup Archive 2009

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

Search the Archive

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

  • To: mathgroup at
  • Subject: [mg102056] Re: [mg102035] Re: [mg102000] How can I "perturbate" a NDSolve
  • From: DrMajorBob <btreat1 at>
  • Date: Tue, 28 Jul 2009 02:03:57 -0400 (EDT)
  • References: <>
  • Reply-to: drmajorbob at

You'll need something like




NumericQ prevents symbolic evaluation of the equations, and  
a[t_?NumericQ]:=a[t]=... makes sure that a[t] is the same every time a  
specific t is used. That's what it takes to make a[t] truly a function of  


On Mon, 27 Jul 2009 04:55:20 -0500, Iván Lazaro <gaminster at>  

> Thanks for the answers!
> I need a more specific perturbation. I need something like this (with  
> this I
> expect to manipulate the frequency of the perturbation)
> If[RandomReal[]<0.001,a=RandomReal[],a=0]
>  NDSolve[{x1'[t] == (Sin[t] + a)*x2[t],
>   x2'[t] == (Cos[t] - a*x1[t]^2)*x1[t], x1[0] == 1,
>   x2[0] == 0}, {x1[t], x2[t]}, {t, 0, 10}]
> But I need that the If condition evaluates in each time step. But I  
> haven't
> been able to introduce the conditional in the ndsolve statment.

DrMajorBob at

  • Prev by Date: bvdae error when using NDSolve for initial value problem
  • Next by Date: Re: Mathematica Animations by High School Students
  • Previous by thread: Re: How can I "perturbate" a NDSolve expresion?
  • Next by thread: Re: Re: Re: How can I "perturbate" a