Solving a matrix equation with a parameter in the coefficient matrix

Hello,
I'm asked to give an expression of S and F in function of theta. This is possible due to 3 given equations. If I make a matrix of these equations and use the linsolve there is an error because of the parameter thetea. Can someone help?
Kind regards,
Tuur
syms theta S F
r = 0.025;
h = 0.3;
rho = 7850;
g = 9.81;
m = r^2 * pi * h * rho;
phi = atan((0.15 - 0.15*sin(theta))/(0.15*cos(theta)))
F_g = [0 , -m * g];
F_s = [-S*cos(phi), S*sin(phi)];
F_p = [F*cos(theta), F*sin(theta)];
eq1 = F_g(1) + F_s(1) + F_p(1) == 0;
eq2 = F_g(2) + F_s(2) + F_p(2) == 0;
eq3 = 0.15*cos(theta)*F*sin(phi) - 0.15*sin(theta)*F*cos(phi) + m * g * 0.15 * cos(theta) == 0;
A = [-cos(phi), cos(theta); sin(phi), sin(theta); 0, 0.15*cos(theta)*sin(phi) - 0.15*sin(theta)*cos(phi)]
B = [0; m * g ; -m * g * 0.15 * cos(theta)]

 採用された回答

Stephan
Stephan 2020 年 11 月 27 日

0 投票

syms theta S F
r = 0.025;
h = 0.3;
rho = 7850;
g = 9.81;
m = r^2 * pi * h * rho;
phi = atan((0.15 - 0.15*sin(theta))/(0.15*cos(theta)));
F_g = [0 , -m * g];
F_s = [-S*cos(phi), S*sin(phi)];
F_p = [F*cos(theta), F*sin(theta)];
eq(1) = F_g(1) + F_s(1) + F_p(1) == 0;
eq(2) = F_g(2) + F_s(2) + F_p(2) == 0;
eq(3) = 0.15*cos(theta)*F*sin(phi) - 0.15*sin(theta)*F*cos(phi) + m * g * 0.15 * cos(theta) == 0;
% New equations
eqn(1) = lhs(eq(1)) == lhs(eq(3));
eqn(2) = lhs(eq(2)) == lhs(eq(3));
sol = solve(eqn,F,S)
pretty(sol.F)
pretty(sol.S)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by