You can use the 'type=numeric' option with the 'dsolve' routine to generate a numerical approximation to the solution of a system of ordinary differential equations. This is often described in Maple literature as `dsolve/numeric`, which is the name of the actual Maple routine that implements the numerical option.
How to plot the results of 'dsolve/numeric' is not immediately obvious. When you use 'dsolve' in this way, what it returns is a procedure that you can later use to numerically estimate the solution at arbitrary points. The results returned by this procedure are not in a format that is immediately recognized by the 'plot' routine. There are three solutions to this problem:
- Use the 'odeplot' routine, for example:
- Convert the output of the numerical procedure into something that 'plot' can accept. This is handy if you want to use some of the plotting options that are not currently available in 'odeplot'. Continuing with the example from above, if you try evaluating p at the location x=1, here is what you get:
We need to isolate the right-hand side of the second item in that list and give it to 'plot':
For Maple programmers looking for a really bullet-proof way for handling lexical scoping of the name 'p', here is how you do it:
- The 'DEtools' package contains several functions including 'DEplot' which you can try wityh the system above: