As an example, solve the SHO numerically in Maxima
- load("dynamics")
- Specify only the RHS of
. Note that dx_dt and dvx_dt are simply names of expressions
- dx_dt : vx
- dvx_dt : -omega^2 * x
- my_odes : [dx_dt,dvx_dt]
- Define the variable names
- var_names : [x,vx]
- Specify initial conditions
- x0 : 1
- vx0 : 0
- ICs : [x0,vx0]
- define the domain of time (independent variable name, span and step) over which the equations will be solved
- t_var : t
- t_start : 0
- t_stop : 10
- t_step : 0.1
- t_domain : [t_var, t_start, t_stop, t_step]
- Issue the command to run
- Z : rk(my_odes,var_names,ICs,t_domain)