Symbolic solution for system of equations

2 visualizzazioni (ultimi 30 giorni)
Pavel
Pavel il 18 Gen 2016
Risposto: Ayush Aniket il 28 Ago 2024
Hello. I'm trying to solve symbolically a equation of type M*Z_DDot+C*Z_Dot+K*Z=F, where M, C, K and F are 3x3 matrices. I want to solve for Z, which is a 3x1 vector containing the displacement of 3 masses. I've written a matlab script but it seems i cannot get around a problem regarding the boundary conditions. I'm using dsolve command and so far i was able to define only the initial displacement of the masses. Please tell me how do I define the velocity and acceleration boundary conditions using dsolve command. I can post the matlab script if necessary. Thank you very much.

Risposte (1)

Ayush Aniket
Ayush Aniket il 28 Ago 2024
Hi Pavel,
You can specify the initial condition for velocity(Z_Dot) and acceleration (Z_DDot) in the following way:
1. While defining the equation, these derivatives will be incorporoated using the diff keyword in the equation as follows:
eqn = M*diff(Z,t,2) + C*diff(Z,t,1) + K * Z == F;
2. Then you can assign some variable names to the derivatives:
Z_Dot = diff(Z,t,1);
Z_DDot = diff(Z,t,2);
3. Finally, you can provide the initial values and plug the eqn and the initial condition cond into the dsolve command to solve your equation:
cond = [Z(0)==Z0, Z_Dot(0)==Z_Dot0, Z_DDot(0)==Z_DDot0];
ZSol(t) = dsolve(eqn,cond);
Refer to the following documentation which shows an example for the same:

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by