Clear Filters
Clear Filters

having trouble defining a non-linear state space model

1 view (last 30 days)
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

Answers (1)

Ryan G
Ryan G on 27 Nov 2012
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.

Categories

Find more on General Applications in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!