Clear Filters
Clear Filters

code/solution for integration with respect in time in matlab

2 views (last 30 days)
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

Answers (1)

Steven Lord
Steven Lord on 24 May 2016
"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.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!