- #1
ques
- 1
- 0
Hi All,
I have modeled a simple spring mass system in Matlab and trying to use linmod to linearize the system.
The system models a mass that hangs from ceiling with a spring and damper. So, the forces that act on the mass are gravity, spring force and damping force. I attached the Simulink model and a picture of the model to the question.
Now, the problem is that, Matlab's linmod seems to completely ignore the gravity (constant block). I would like to know how should I change the model or simulation parameters to get correct results.
state vector x is [h V]' (height and speed)
output vector y is [h a] (height and acceleration)
input vector is empty
linmod('trim_linmod_test') gives following matrices:
A:
0.0000 1.0000
-0.5000 -0.5000
C:
1.0000 0.0000
-0.5000 -0.5000
B,D empty because there are no inputs.
Now,
y= C*x, hence a = -0.5 * h - 0.5*V
On the other hand, if we simply look at the model we can see that
a = (-5*h - 5*V + 9.81) / (m) ( m = 0.1, the gain block )
So, obviously, the constant block is ignored.
I can see that the state space equation of the form y=C*x can't really represent the gravity term. C is a 2x2 matrix but acceleration equation needs 3 terms.
I thought of making gravity an input. This way state space equation will be y = C*x + D*u and there are enough terms to represent acceleration. But this doesn't really look logical to me.Thanks in Advance
Homework Statement
I have modeled a simple spring mass system in Matlab and trying to use linmod to linearize the system.
The system models a mass that hangs from ceiling with a spring and damper. So, the forces that act on the mass are gravity, spring force and damping force. I attached the Simulink model and a picture of the model to the question.
Now, the problem is that, Matlab's linmod seems to completely ignore the gravity (constant block). I would like to know how should I change the model or simulation parameters to get correct results.
Homework Equations
state vector x is [h V]' (height and speed)
output vector y is [h a] (height and acceleration)
input vector is empty
linmod('trim_linmod_test') gives following matrices:
A:
0.0000 1.0000
-0.5000 -0.5000
C:
1.0000 0.0000
-0.5000 -0.5000
B,D empty because there are no inputs.
Now,
y= C*x, hence a = -0.5 * h - 0.5*V
On the other hand, if we simply look at the model we can see that
a = (-5*h - 5*V + 9.81) / (m) ( m = 0.1, the gain block )
So, obviously, the constant block is ignored.
The Attempt at a Solution
I can see that the state space equation of the form y=C*x can't really represent the gravity term. C is a 2x2 matrix but acceleration equation needs 3 terms.
I thought of making gravity an input. This way state space equation will be y = C*x + D*u and there are enough terms to represent acceleration. But this doesn't really look logical to me.Thanks in Advance