MathGroup Archive 2007

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

Search the Archive

Re: Solving a differential equation numerically in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75388] Re: Solving a differential equation numerically in Mathematica
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Sat, 28 Apr 2007 05:52:12 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f0sfvm$ndg$1@smc.vnet.net>

Blake Jackson wrote:
> Hi all, 
> 
> Does anyone know if Mathematica can numerically solve a second order differential equation?
> 

Sure it can. Search the documentation for *NDSolve* [1]. For example 
(adapted from [2], which is a nice and short introduction to solving 
ODEs with Mathematica),

In[1]:=
sol = NDSolve[
    {Derivative[2][x][t] + gamma*Derivative[1][x][t] +
        x[t]^3 == A*Cos[t], x[0] == 0.6,
      Derivative[1][x][0] == 1.25} /.
     {gamma -> 0.15, A -> 0.3}, x, {t, 0, 100}]
Plot[x[t] /. sol, {t, 0, 100}]

Out[1]=
{{x -> InterpolatingFunction[]}}

Out[2]=
Graphics[]

Regards,
Jean-Marc

[1] _Mathematica 5.2 Documentation_, "Built-in Functions / Numerical 
Computation / Equation Solving / NDSolve", 
http://documents.wolfram.com/mathematica/functions/NDSolve

[2] _Integrating Equations of Motion in Mathematica_, Gary L. Gray, 
Assistant Professor, Engineering Science and Mechanics, The Pennsylvania 
State University, 
http://www.esm.psu.edu/courses/emch12/IntDyn/course-docs/Mathematica/MmaGuide-GLG.pdf


  • Prev by Date: Re: FourierCosTransform
  • Next by Date: Re: FourierTransform and removable singularities
  • Previous by thread: Re: Solving a differential equation numerically in Mathematica
  • Next by thread: Re: Solving a differential equation numerically in Mathematica