## Mathematics & Science
Learning Center |
|||||||||||||||

## Solving Systems## Solving the Preliminary Example
## Solving the Problem NumericallyLet me remind you of the syntax of
?NDSolve The syntax check shows us five possible versions of NDSolve, but a careful reading reveals that the last version is
the one that we'll need:
…] solves for the functions u."_{i}Notice the reference to So far the problem that we have been working has been a simple system of
differential equations, but in order to find a numerical solution we need to
get more specific, remember? What is it that we're missing? I hope you said
Now when I proposed the solution that we spent so long checking a little earlier, I had a specific pair of initial conditions in mind, namely: *x*(0) = 1*y*(0) = 1
(With Putting these together with our original system we get the larger system:
These equations can be inserted into the NDSolve command,
but we need one other piece of information. The numerical solver requires that
we specify a finite interval upon which the solution is to be found. Since
our initial condition is at 0, let's sandwich this value with our solution
using the interval -2 ≤ If we wish to read the result into the variable prelimsol, the command we'll use will be: prelimsol= NDSolve[{x'[t]== y[t]- x[t]- E^(3t), y'[t]==3 y[t]+2 x[t]-2 E^(-t), x[0]==1,y[0]==1}, {x[t],y[t]},{t,-2,2}] Let's go try it out. Come back here when you're done. Now let's look at what you should have gotten... |
|||||||||||||||

ODE Laboratories: A Sabbatical Project by Christopher A. Barker©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA e-mail: cbarker@deltacollege.edu |