Convert series of analytical solutions to matrix vector format

1 回表示 (過去 30 日間)
Teun
Teun 2024 年 3 月 18 日
回答済み: Walter Roberson 2024 年 3 月 18 日
Hello, I have three analytical solutions solutions as a result of differientiating the same equation with respect to three different variables (C3, C4, and C5). I wish to convert the solutions in matrix vector format as followed:
I either wish to determine the constants Ai,j or directly convert my solutions to the matrix format. Thanks in advance!
Code:
syms x I E0 B l C3 C4 C5 F kt
V1 = int(1/2 * I * E0 * (1 + (B-1) * x/l) * (2*C3 + 6*C4*x + 12*C5*x^2)^2, x, 0, l);
V2 = int(1/2 * F * (2*C3*x + 3*C4*x^2 + 4*C5*x^3)^2, x, 0, l);
V3 = 1/2 * kt * (C3*l^2 + C4*l^3 + C5*l^4)^2;
V = V1 - V2 + V3;
dV1 = diff(V,C3)
dV1 = 
dV2 = diff(V,C4)
dV2 = 
dV3 = diff(V,C5)
dV3 = 

採用された回答

Walter Roberson
Walter Roberson 2024 年 3 月 18 日
syms x I E0 B l C3 C4 C5 F kt
V1 = int(1/2 * I * E0 * (1 + (B-1) * x/l) * (2*C3 + 6*C4*x + 12*C5*x^2)^2, x, 0, l);
V2 = int(1/2 * F * (2*C3*x + 3*C4*x^2 + 4*C5*x^3)^2, x, 0, l);
V3 = 1/2 * kt * (C3*l^2 + C4*l^3 + C5*l^4)^2;
V = V1 - V2 + V3;
dV1 = diff(V,C3);
dV2 = diff(V,C4);
dV3 = diff(V,C5);
[A, b] = equationsToMatrix([dV1; dV2; dV3], [C3, C4, C5])
A = 
b = 

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by