What is the mass matrix in ode solvers in MATLAB?
Asked Answered
A

2

8

Without using a mass matrix, ode solvers like ode45 can solve y'=f(t,y).

But there is an option of mass matrix in ode solvers for problems that involve a "mass" matrix, M(t,y)y'=f(t,y).

What exactly is the "mass" matrix? Does this term come from the mass of mass-spring system oscillation? I cannot find an example code about this in the documentation. Also, it seems that I can encode information about t and y in f(t,y) in the equation of y'=f(t,y). In what situation/example will M(t,y)y'=f(t,y) arise where M(t,y) is needed?

Atween answered 26/6, 2016 at 4:37 Comment(0)
O
2

This is explained fully here in the documentation for odeset. Yes, it can be related to the mass/inertia term for second order systems, but it can also represent different parameters in other systems that have the same form. This option can improve efficiency in some cases and handle singular (non-invertible) mass matrices (uncommon is physical systems).

The book Solving ODEs with Matlab (PDF) by Shampine, et al. provides further details and a nice example (section 2.3.2, page 105) – see batonode in Matlab.

Offutt answered 27/6, 2016 at 4:20 Comment(0)
S
1

The mass matrix can be used to solve coupled ordinary differential equations and algebraic equations simultaneously.

For example

y'(1) = 2y(1) + 3(y)^2
y'(2) = 5y(1) - 2y(2)^4
0 = y(1)^3 + y(3) + 2
0 = y(2)^4 + y(4) - 8

can be solved using ode23t with a mass matrix as:

M =
[1 0 0 0
0 1 0 0
0 0 0 0
0 0 0 0]

Note than few ode solvers cannot handle singular mass matrix well. ode23t and ode15s can do this job.

For more details refer: https://se.mathworks.com/help/matlab/ref/odeset.html#input_argument_namevalue_d119e730030

Surgical answered 17/11, 2017 at 14:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.