Solving system of first order linear differential equations
Afficher commentaires plus anciens
I wanted to solve a system of first order linear differential equations in MATLAB. Expressed in terms of matrices, the equation is of the form
. In this equation, the matrix C is a constant matrix which can be determined from the user input. So the solution to this equation if of the form
for each eigenvalue
of the matrix, and its corresponding eigenvector
. My aim is to plot the dependent variables in the system as functions of time.
So I know the command eig to get the eigenvalues and corresponding eigenvectors. After getting these, how do I express the set of variables
as per the equation above. Assume that the constants
can be determined from initial conditions.
Note: I also saw that ode45 can be used in this case, but I wanted to learn how to express the equation using symbols in MATLAB. Any help will be appreciated. TIA
1 commentaire
madhan ravi
le 20 Déc 2018
Modifié(e) : madhan ravi
le 20 Déc 2018
posting the datas of your equation would help
Réponses (1)
Star Strider
le 20 Déc 2018
0 votes
You can use the numeric solvers if that works for you. It may be easier to use the expm (link) function for a linear problem such as this. Don’t worry about the eigenvalues — expm has already implemented the Cayley-Hamilton Theorem for you with respect to the matrix exponential.
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!