having trouble defining a non-linear state space model

1 次查看(过去 30 天)
Ive been trying for the past few hours to figure out how to input a non-linear ss model and Im at a loss. the model ive been trying to input is a simple pendulum with an applied torque Tc with x1=theta and x2=thetadot
[xdot1;xdot2] = [0 x2; -9.81sin(x1) +Tc 0] y=x1
^^that is not the code i used thats the model on paper that ive been trying to input.
when i define the matricies A,B,C,and D using this code; A= [0 1;(-9.81*sin(x1)+Tc) 0]; B= [0]; C= [1]; D=[0];
then run ss(A,B,C,D)
i get an error saying: Error using ss (line 274) The value of the "a" property must be a numeric array without any Inf's or NaN's.
now im assuming the error is because of the way ive defined the A matrix with the sin(x1) in there but i have no idea how else to define that model and ive been searching the matlab guide and the internet for hours now.
anyhelp would be AWESOME

回答(1 个)

Ryan G
Ryan G 2012-11-27
There are two issues here:
1) The SS model is incorrect. The applied torque should be modeled as an input which is part of the B matrix. 2) You are attempting to symbolically utilize the SS function and this cannot be done.
If you want to model the system I would suggest Simulink. Otherwise you can linaerize the model at difference points along the arc.

类别

Help CenterFile Exchange 中查找有关 General Applications 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by