Why do the same system matlab and simulink get different step responses?

조회 수: 10 (최근 30일)
帆
2024년 7월 25일
댓글: Sam Chak 2024년 7월 25일
As I asked, I want to design a fractional pid controller for a model. Unfortunately, the results I got with step in matlab are quite different from those in simulink
.
Here the orange line is the output and the blue line is the offset,Now let me show you the situation of matlab.The specific parameters of the controller are consistent with the code below
cs=fopid(9.503084707494814e+03,1.889631254823942e+02,2.304958553299564e+02,0.058440555124293,1.558103446462550);%This is parameter of controller
gs=tf(118700,[1 1085 1224000]);%This is the transfer function of the controlled object
step(feedback(cs*gs,1))%Step Response of Closed-loop Transfer Function
This is the general situation. I feel confused now.
  댓글 수: 1
Sam Chak
Sam Chak 2024년 7월 25일
Hi Fan, I believe that you have used the custom Simulink block and fopid() function file for the problem.
Without knowing what's inside the fractional order PID controller block mask, and the block configuration, it's difficult to identity the root cause.

댓글을 달려면 로그인하십시오.

답변 (1개)

tom
tom 2024년 7월 25일
Differences in step responses between MATLAB and Simulink can arise due to:
  1. Solver Settings: Simulink uses various numerical solvers which may differ from MATLAB’s fixed algorithms.
  2. Time Representation: Discrete vs. continuous time implementations can cause variations.
  3. Initial Conditions: Ensure both systems have the same initial conditions.
  4. System Representation: Simulink’s block diagram approach may introduce numerical differences compared to MATLAB’s state-space or transfer function methods.
  5. Model Complexity: Simulink models might include nonlinear elements that MATLAB assumes linear.
To align results:
  • Use similar solver settings.
  • Match initial conditions.
  • Ensure consistent time representation.
  • Simplify Simulink models to match MATLAB’s analytical models.
  • Compare intermediate outputs to identify discrepancies.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by