MATLAB: Variable mass matrix in ode

ode15s variable mass matrix

hi every one i try to solve problem with ode15s that Mass matrix change per step how can i solve?

Best Answer

Use odeset to create an options structure where the 'Mass' option is set to a function handle. Take a look at the batonode example, which defines a Mass function that generates a state-dependent mass matrix, or the fem1ode example if your mass matrix is going to depend only upon time and not the state.