Numerical IVP solution¶
The equation u′=sin[(u+t)2] also has a solution that can be found numerically with ease, even though no formula exists for its solution. The DifferentialEquations
package offers solvers for a variety of problems. Because many practical problems come with parameters that are fixed within an instance but varied from one instance to another, the syntax for IVPs includes a input argument p
that stays fixed throughout the solution. Here we don’t use that argument, but it must be in our definition for the solver to work.
With the data above we define a “problem object” and then solve it. We tell the solver to use the Tsit5
method, which is a good first choice for most problems.
The plot
function knows natively how to plot this solution.