Numerically solve an ODE in Maxima

As an example, solve the SHO numerically in Maxima

  1. load("dynamics")
  2. 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]
  3. Define the variable names
    • var_names : [x,vx]
  4. Specify initial conditions
    • x0    : 1
    • vx0 : 0
    • ICs : [x0,vx0]
  5. 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]
  6. Issue the command to run
    • Z : rk(my_odes,var_names,ICs,t_domain)