- There are two methods to solver a system of ODEs with multiple initial conditions. One method is to use a for-loop over the initial conditions, which I will assume is the method being used currently. Another faster method is to use vectorization to solve for every initial condition simultaneously. This improves the performance of the code significantly. You can refer to the following documentation about these two methods:
- ODEs can be “stiff” that a “non-stiff” solver like “ode113” will be slow and inefficient in solving them. You can refer to the following documentation to understand stiffness in ODEs:
- The “odeset” command creates an “options” structure that can be passed as an argument to the ODE solver. Apart from the “InitialStep” field, the “Jacobian” matrix can be provided for improving the performance, especially for stiff ODE solvers. You can refer to the following documentation about the various options available in addition to the “Jacobian”:
- You can refer to the following example on equations of motion. The example solves a system of equations of motion for a baton thrown into the air: