Can I use d/dt or overdot notation for symbolic equations?
조회 수: 19 (최근 30일)
이전 댓글 표시
Using symbolic equations Matlab does some handy stuff like converting theta_1 to the greek symbol with the appropriate subscript. Is there a way to convert a derivative the same way? So that it will display as dtheta/dt or with an overdot (latex: \dot{\theta})?
채택된 답변
Beck
2025년 9월 24일
Define your derivative variables in your syms call, then use subs() to swap the symbols in the display:
syms theta(t) theta_dot
x = theta
y = diff(x,t)
y = subs(y,diff(theta,t), theta_dot)

If you have a lot of symbols to replace, use sets. Just be careful of the order in which you replace symbols: you should go from highest order derivative to lowest.
syms theta(t) theta_dot theta_ddot omega(t) omega_dot omega_ddot
x = omega + theta;
y = diff(x,t);
z = diff(x,t,t);
oldsyms = {diff(theta,t,t), diff(omega,t,t), diff(theta,t), diff(omega,t)};
newsyms = {theta_ddot, omega_ddot, theta_dot, omega_dot};
y = subs(y, oldsyms, newsyms)
z = subs(z, oldsyms, newsyms)

댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
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!