Symbolic solution for system of equations

2 ビュー (過去 30 日間)
Pavel
Pavel 2016 年 1 月 18 日
回答済み: Ayush Aniket 2024 年 8 月 28 日
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.

回答 (1 件)

Ayush Aniket
Ayush Aniket 2024 年 8 月 28 日
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:

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by