Besides ‘ode2’, ‘contrib_ode’ also solves differential equations.
While ‘ode2’ fails:
This is an example taking from page 4 of Bender and Orszag’s “Advanced Mathematical Methods for Scientists and Engineers“. On the same page, there is another good example:
is a constant.
Using ‘contrib_ode’, we have
It seems that ‘contrib_ode’ is a better differential equation solver than ‘ode2’:
Even though it is not perfect:
From the examples, we see the usage of ‘contrib_ode’ is the same as ‘ode2’. However, unlike ‘ode2’, ‘contrib_ode’ always return a list of solution(s). It means to solve either initial-value or boundary-value problem, the solution of the differential equation is often lifted out of this list first:
Exercise Solve the following differential equations without using a CAS:
- (hint: Riccati Equation)