Simulink : Unstable response for a stable system

16 views (last 30 days)
I have modeled a spring mass damper system along with a compensator in simulink. The transfer function of the spring mass damper system goes like this 1/(Ms^2+bs+k) where m=5.2e-6 b=6.25e-5 k=70 Am getting a stable response when i actually code this in matlab.But in simulink using ode45 dormand-prince, am getting a unstable response. Pls help me out in this, as this is my fisrt step in modeling a micro accelerometer.

Accepted Answer

Simon Stroebel
Simon Stroebel on 14 Mar 2011
Hello Omkar,
I investigated your system a little bit, and I think I can give you some answers. I think your problem is due to the numerical values of your system paramters. Since you are modelling a (mechnaical) spring mass damper system, the parameters can be interpreted as follows:
M: mass
b: (linear) friction
k: spring rate
With these parameters, you create a Model with transfer function G(s) = 1/(Ms^2 + bs + k). This is a LTI-Model, more precisely a so called PT2-System. The numerical values of the characteristic coefficients of this PT2-System are (based on the numerical values of your system parameters):
w0 = 3.6690e+003 (Eigenfrequency)
D = 0.0016 (Damping)
K = 0.0143 (Gain)
the two Eigenvalues of the corresponding System Matrix A = [0 1; -w0^2 -2*D*w0] are:
1.0e+003 *
-0.0060 + 3.6690i
-0.0060 - 3.6690i
--> Your System has complex Eigenvalues with small real parts and large imaginary parts (compared to each other). The consequence is that your system is a so called "stiff" system.
"explicit" solvers, as ode45 for example, have problems to solve stiff systems, respectively they are not designed to solve these problems. Therefore Simulink offers other solvers, especially designed to solve stiff systems. One of such a solver is ode15s for example. If I use this solver, I get the same results as when I simulate the step response with the "step" command offered by the control toolbox.
The solution for you may be, that you use a solver that fits your problem.
I hope this will help you...
  4 Comments
Omkar
Omkar on 15 Mar 2011
I ran my model with values of max step and tolerance you gave.I got a fair enough response. Thanks for that.
could pls explain what exactly is relative tolerance?
Paulo Silva
Paulo Silva on 15 Mar 2011
+1 vote for a good answer, looking forward to see more answers from you Simon Stroebel

Sign in to comment.

More Answers (2)

Simon Stroebel
Simon Stroebel on 14 Mar 2011
Hello Omkar, it would be neccessary to know if you used the "Transfer Function" Block in your Simulink Model, or if you coded it via a "real" Block Diagramm, that means with Integrators, Gain and Sum Blocks. In the latter case, you probably may have mixed up the signs in the Sum Blocks? This is common mistake which leads to "unstable" system responses of stable systems.
  1 Comment
Omkar
Omkar on 14 Mar 2011
Thnks for ur reply simon.
I used the transfer function block available in the simulink browser and then entered my num and den coefficients. I had also this with integrator blocks. Got the same unstable result for both. when i keep my M=1 , b=2, k=4, then am getting a stable response but not for the actual values i mentioned.

Sign in to comment.


Arnaud Miege
Arnaud Miege on 14 Mar 2011
I tried these values with the transfer function block in Simulink and a step input and I get a stable input if I use ode23t, ode23s or ode23tb, with a max step size of 0.01s. It is however, a marginally stable system. Consider increasing the damping to make the system less stiff. ode45 is not well suited for numerically stiff systems, as has been pointed out already.
HTH,
Arnaud
  3 Comments
Arnaud Miege
Arnaud Miege on 14 Mar 2011
What MATLAB code are you using to solve the system? Make sure you are using the same solver if you use an ode solver. Using:
m=5.2e-6; b=6.25e-5; k=70;
msd = tf(1,[m b k]);
step(msd,10)
I get the same response.
Omkar
Omkar on 14 Mar 2011
i used the same code as u have mentioned. I get a response where the overshoot is 97.5% and settling time around 0.68s.
Now when i do this in simulink by having a transfer function block,
a step input, a scope and setting the solver to ode23s and running the simulation for 1s, i get same steady state value but the response is nowhere similar to one i get using code.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!