code/solution for integration with respect in time in matlab

2 次查看(过去 30 天)
Hai fellow friends,
I have a question regarding the integration with respect to time. I have a simple equation as follow:
tau = theta1_dd(t)*((m1 + m2)*L1^2 + I1) + L1*g*sin(theta1(t))*(m1 + m2) + L1*L2*m2*theta2_dd(t)*cos(theta1(t) - theta2(t)) + L1*L2*m2*sin(theta1(t) - theta2(t))*theta2_d(t)
theta2_dd(t)*(m2*L2^2 + I2) + L2*g*m2*sin(theta2(t)) + L1*L2*m2*theta1_dd(t)*cos(theta1(t) - theta2(t)) - L1*L2*m2*sin(theta1(t) - theta2(t))*theta1_d(t)
I tried using int (tau). However, the result was integrated with thetas' not with time. Could anyone here help me regarding this issue? thanks :)
Regards, Siti

回答(1 个)

Steven Lord
Steven Lord 2016-5-24
"int(expr,var) computes the indefinite integral of expr with respect to the symbolic scalar variable var. Specifying the variable var is optional. If you do not specify it, int uses the default variable determined by symvar."
So specify var, the variable with which you want expr to be integrated, in your int call.

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by