Solve symbolic equation for a variable which itself is a function of time
9 次查看(过去 30 天)
显示 更早的评论
Hello
I am trying to solve a symbolic equation for the variable, theta_ddot.
I have defined the angle (theta) and acceleration (theta_ddot) as time dependant, which seems to cause a problem when I try to solve the equation symbolically. MATLAB give the warning: "Warning: Unable to find explicit solution. For options, see help"
I have tried to not define theta and theta_ddot as time dependant which solves the problem. However I need them to be time dependant since I have to take the time derivative later on so I can't do that.
I have attached my code below
syms m a J theta_ddot(t) theta(t) tau_1 g eq1
eq1 = (m*a^2 + J) * theta_ddot + a*g*m*cos(theta)
S = solve(tau_1 == eq1,theta_ddot)
Hope someone can help explain what seems to be the problem. :)
Thanks in advance
0 个评论
回答(1 个)
Steven Lord
2023-9-26
2 个评论
Walter Roberson
2023-9-26
编辑:Walter Roberson
2023-9-26
syms m a J theta_ddot(t) theta(t) tau_1 g eq1
theta_dot = diff(theta);
theta_ddot = diff(theta_dot);
eq1 = (m*a^2 + J) * theta_ddot + a*g*m*cos(theta)
S = dsolve(tau_1 == eq1)
tdd = diff(S, t, t)
simplify(tdd, 'steps', 50)
Derivative of union is not a good sign.
In the final result, the reason for there to be a conditional on the 0 and for there to be no other values, is that it is MATLAB's way of saying that the solution can be defined as 0 under those particular cases, but is otherwise undefined.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!