Second order differential equation with large matrices
Show older comments
Greetings,
I am tryig to solve this differential equation M * q'' + K * q= - K_d * q' - K_p * (q - q_d) where M is a 15x15 matrix, q is 15x1 vector, K is a 15x15 matrix, K_d and K_p are 15x15 known matrices and q_d is a 15x1 vector which is also known. q'' is a second time derivative. Which solver is the most applicable for this equation? and is there way to solve this in a matrix form and not expand the whole equation. Thanks in advance.
6 Comments
David Togonidze
on 4 Dec 2022
Jan
on 5 Dec 2022
As Torsten has explained alreayd, rewrite to 2nd order ODE to a system of order 1 equations. You can use matrices to evaluate this system. This is one of the fundamental design ideas of Matlab. Simply write the system as matrix equation.
David Togonidze
on 6 Dec 2022
David Togonidze
on 10 Dec 2022
One question guys. Let's say matrix M is not constant and is dependent on q, so at every time step M changes accordingly to the values of q calculated at previous time step (starting from initial condition q0). How can i incorporate that into the odesystem function for ode45 solver? Thank you in advance
By dividing through M (assuming M is non-singular):
q'' = M \ (- K * q - K_d * q' - K_p * (q - q_d) )
If M is singular, define M as mass-matrix for the ODE solver in the options-structure and use ode15s or ode23t instead of ode45.
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
