How to present (x(t))'', (θ(t))'' in symbolic version matlab?

8 ビュー (過去 30 日間)
Matthew Worker
Matthew Worker 2023 年 2 月 6 日
回答済み: Walter Roberson 2023 年 2 月 6 日
There are six equations below (M, m, g, b, L, J are constant):
M*(x(t))'' = F(t) - N(t) - b*(x(t))'
J*(θ(t))'' = P(t)*sin(θ(t))*(L/2) - N(t)*cos(θ(t))*(L/2)
m*(xp(t))'' = N(t)
m*(yp(t))'' = P(t) - mg
xp(t) = x(t) +(L/2)*sin(θ(t))
yp(t) = (L/2)*cos(θ(t))
I want to combine and simplify these 6 symbolic equations into 2 symbolic euqations only presented by x(t), θ(t) and F(t).
However, I do not know how to show the (x(t))'', (θ(t))'' in symbolic version. Can anyone help me with it?
syms x(t)?

採用された回答

Walter Roberson
Walter Roberson 2023 年 2 月 6 日
syms b J g L M m
syms F(t) N(t) P(t) theta(t) x(t) xp(t) yp(t)
x_prime = diff(x);
x_dprime = diff(x_prime);
theta_prime = diff(theta)
theta_prime(t) = 
theta_dprime = diff(theta_prime);
xp_prime = diff(xp);
xp_dprime = diff(xp_prime);
yp_prime = diff(yp);
yp_dprime = diff(yp_prime);
eqn1 = M*xp_dprime == F - N - b*x_prime
eqn1(t) = 
eqn2 = J*theta_dprime == P*sin(theta)*(L/2) - N * cos(theta)*(L/2)
eqn2(t) = 
eqn3 = m*xp_dprime == N
eqn3(t) = 
eqn4 = m*yp_dprime == P - m*g
eqn4(t) = 
eqn5 = xp == x + (L/2)*sin(theta)
eqn5(t) = 
eqn6 = yp == (L/2)*cos(theta)
eqn6(t) = 

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by