Solve differential equations (solve_ode)
Solve a differential equation, or a system, with optional initial conditions.
Also written solve_pde.
With this function, the solver shows the steps whenever it finds them.
How to write it
solve_ode(equations, unknown, variable)
Solve for the unknown function of the variable.
- equations
- The equation, or a list that includes initial conditions such as y(0) = 1. Takes an equation, or a list of equations in brackets.
- unknown
- The unknown to solve for, such as y. Takes a variable, or a list of variables.
- variable
- The variable to work with, a name such as x. Takes a variable, or a list of variables.
Examples
solve_ode(y'(x) = y(x), y, x)In the solver,
Open in the solversolve_ode(y'(x) = y(x), y, x)gives[[y(x) -> C(1)*e^x]].solve_ode([y'(x) = y(x), y(0) = 1], y, x)In the solver,
Open in the solversolve_ode([y'(x) = y(x), y(0) = 1], y, x)gives[[y(x) -> e^x]].solve_ode(y''(x) + y(x) = 0, y, x)In the solver,
Open in the solversolve_ode(y''(x) + y(x) = 0, y, x)gives[[y(x) -> C(1)*cos(x) + C(2)*sin(x)]].
Related functions
- solve_recurrence
Solve a recurrence relation for a sequence.
- recurrence_growth
The order of growth of a divide-and-conquer recurrence, as big_theta of a simple function.