MathGroup Archive 2007

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

Search the Archive

Nonautonomous ODEs

I am having a problem with the numerical solution of non-autonomous 
ODEs. For example, I have the following code for a simple linear 2nd 
order ODE with a forcing function, F[t_]

a = 36;
b = 12;
c = 145;
t0=0; tmax = 20;
eqn := a x''[t] + b x'[t] + c x[t] == F[t]
F[t_] := 100 Exp[-t/6]Cos[2 t];

The following code gives its analytical solution and a plot of the 
solution for zero initial conditions,

  soln = DSolve[{eqn,x[0]==0,x'[0]==0},x[t],t]//Simplify
  truesoln = x[t]/.soln

The numerical solution and its plot can be obtained with,

  soln = NDSolve[{eqn,x[0]==0,x'[0]==0},x[t],{t,t0,tmax}];

My problem, is that suppose the driving function is a sequence of unit 
amplitude rectangular pulses, each with width of 0.3 and having a period 
1.0, then how can F[t_] be defined so that NDSolve can be used to obtain 
a numerical solution?

--V. Stokes

  • Prev by Date: Re: plot question
  • Next by Date: Re: plot question
  • Previous by thread: Re: Convolution Integral
  • Next by thread: Re: Nonautonomous ODEs