29.9. COMPUTER ALGEBRA METHODS 567
Observation 29.8.7 What are the main differences between linear and nonlinear equa-tions? Linear initial value problems have an interval of existence which is the same asthe interval on which the functions in the equation are continuous. Nonlinear initial valueproblems sometimes don’t. Solutions to linear initial value problems are unique. This is notalways true for nonlinear equations although if in the nonlinear equation, f and ∂ f/∂yare both continuous, then you at least get uniqueness as well as existence on some possiblysmall interval of undetermined length.
29.9 Computer Algebra MethodsThe above methods work very well except for when they don’t, which is the typical case.One can use computer algebra systems to solve such equations. In this section, the use ofvarious systems will be discussed. The intent here is to give a reasonably simple way toobtain these solutions, not to give all possible ways to use these systems. In this book, Iwill be emphasizing MATLAB. However, other systems will be discussed in this section.One very easy to use system which behaves a lot like MATLAB is Scientific Notebook,which is actually based on mupad. I will mention its use also.
29.9.1 MATLABA frequently used computer algebra system is MATLAB. You can use this to find solutionsto the initial value problem. If you want commands to appear on separate lines, you use“shift enter”.
The basic version of MATLAB is sufficient to do the numerical procedures discussed.In order to do procedures which involve commands like “syms” you will need to have thesymbolic math toolbox also. In particular, you need this toolbox for the first example givenhere in which “dsolve” is used, but not for the numerical procedures mentioned next.
Here is what you type to get MATLAB to compute the solution to
y′ = y− .01y2,y(0) = 2.
After the >> you type the following:
syms y(t); y(t)=dsolve(diff(y,t)==y - .01*yˆ2, y(0)==2)
After typing in the above, you press enter and here is what results.
>>syms y(t); y(t)=dsolve(diff(y,t)==y-.01*yˆ2,y(0)==2)y(t) =100/(exp(log(49) - t)+1)
If you want a graph of this solution, this is also easy to get. After doing the above, typein the following to the right of >>
ezplot(y(t),[0,3])
and then press “enter” to obtain the graph of the solution on the interval [0,3].