Different results in MATLAB and Simulink

2 views (last 30 days)
Hi guys,
I have the same system in both MATLAB and Simulink, and each system has a different step response. One is stable and the other is not. How can I solve this problem? I have attached the systems and responses.
Thanks.

Accepted Answer

Stephan
Stephan on 11 Jul 2018
Edited: Stephan on 11 Jul 2018
Hi,
your two systems differ in the second number in the numerator of your transfer function by about a factor of 10:
here you have:
.
0.0001
.
and in the second System you got:
.
which is rounded: 0.001
.
So the numbers are different by factor:
>> 0.0009955 / 0.0001
ans =
9.955
I think if you fix this you will get the same results.
Best regards
Stephan
  5 Comments
Hussein Harb
Hussein Harb on 11 Jul 2018
The problem was that those systems are results of using (c2d) on continuous systems. So when I try to enter them in discrete time directly I get instability. And I couldn't find the older systems.
Anyways, the problem is apparently from approximations. The systems I'm getting have poles close to 1. So the results of the c2d command must have stable roots, while when entering the system manually, I must be getting different roots due to the approximations.
Do you know how I can increase the precision of MATLAB's calculations.
Thanks!
Stephan
Stephan on 11 Jul 2018
To be honest, I do not know that, so I recommend you ask this in a new question.Since the answer to the current question has already been accepted, I suspect that you will find relatively little response to this new question. But there are several very informed people in the forum who can help you, if you turn theit attention to a new unanswered question.
Best regards
Stephan

Sign in to comment.

More Answers (0)

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!