How to find out which sates were used for linmod of a SimMechanics model?
Show older comments
Hallo!
Ive set up a multibody model in SimMechanics 2nd Gen. It contains 4 spherical joints as well as 3 rigid bodies. I want to obtain a StateSpace model using the linmod function. Performing a linerization I do get a SS with 27 states. But how can I find out which state refers to which parameter of my SimMechanics model. Is there a way to obtain information on the states like: state 1 refers to the angular displacement in Joint 1.
Sadly, the state names do not contain this information.
G =
a: [27x27 double]
b: [27x2 double]
c: [0 0 0 0 0 0 0 0 0 0 2.0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
d: [0 0]
StateName: {27x1 cell}
OutputName: {'model/Out1'}
InputName: {2x1 cell}
OperPoint: [1x1 struct]
Ts: 0
>> G.StateName
ans =
'model/Arm-Object-Arm_System1/Shoulder_ Joint_1'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_1'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_1'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_1'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_1'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_1'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_1'
'model/Arm-Object-Arm_System1/Wrist_Joint_1'
'model/Arm-Object-Arm_System1/Wrist_Joint_1'
'model/Arm-Object-Arm_System1/Wrist_Joint_1'
'model/Arm-Object-Arm_System1/Wrist_Joint_1'
'model/Arm-Object-Arm_System1/Wrist_Joint_1'
'model/Arm-Object-Arm_System1/Wrist_Joint_1'
'model/Arm-Object-Arm_System1/Wrist_Joint_1'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_2'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_2'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_2'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_2'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_2'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_2'
'model/Arm-Object-Arm_System1/Shoulder_ Joint_2'
'model/Arm-Object-Arm_System1/Simulink-PS Converter/EVAL_KEY/EXEC_INPUT_1'
'model/Arm-Object-Arm_System1/Simulink-PS Converter1/EVAL_KEY/EXEC_INPUT_1'
'model/Arm-Object-Arm_System1/Simulink-PS Converter2/EVAL_KEY/EXEC_INPUT_1'
'model/Arm-Object-Arm_System1/Simulink-PS Converter3/EVAL_KEY/EXEC_INPUT_1'
'model/Arm-Object-Arm_System1/Simulink-PS Converter4/EVAL_KEY/EXEC_INPUT_1'
'model/Arm-Object-Arm_System1/Simulink-PS Converter5/EVAL_KEY/EXEC_INPUT_1'
Thereafter, using minreal function i want to reduce the order of the system. And here is my second question: How to find out which states were eleminated by minreal().
Regards, Florian
Answers (1)
Arkadiy Turevskiy
on 26 Sep 2013
Edited: Arkadiy Turevskiy
on 26 Sep 2013
Hi,
As you mention, linmod does not support his functionality. linmod is a legacy Simulink function that is no longer actively developed. The actively developed function for linearization is linearize. This function is part of Simulink Control Design which provides a lot of functionality for trimming and linearizing Simulink models.
If you use linearize , you will get the information that you want. For example, linearizing this example with linmod I get these states:
- 'sm_cart_double_pendulum/Cart and Double Pendulum/Guide-CartPrismatic'
- 'sm_cart_double_pendulum/Cart and Double Pendulum/Guide-CartPrismatic'
- 'sm_cart_double_pendulum/Cart and Double Pendulum/Lower Revolute'
- 'sm_cart_double_pendulum/Cart and Double Pendulum/Lower Revolute'
- 'sm_cart_double_pendulum/Cart and Double Pendulum/UpperRevolute'
- 'sm_cart_double_pendulum/Cart and Double Pendulum/UpperRevolute'
Linearizing using linearize I get these states:
- 'Cart_and_Double_Pendulum.Guide_Cart_Prismatic.Pz.p'
- 'Cart_and_Double_Pendulum.Guide_Cart_Prismatic.Pz.v'
- 'Cart_and_Double_Pendulum.Lower_Revolute.Rz.q'
- 'Cart_and_Double_Pendulum.Lower_Revolute.Rz.w'
- 'Cart_and_Double_Pendulum.Upper_Revolute.Rz.q'
- 'Cart_and_Double_Pendulum.Upper_Revolute.Rz.w'
As for the second part of your question, you should be able to see which states were eliminated by doing:
linsys1=minreal(linsys);
linsys1.StateName
and comparing the result with:
linsys.StateName
Hope this helps.
Arkadiy
Categories
Find more on Assembly 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!