Issue with initial value of a controlled variable

13 views (last 30 days)
I'm trying to model a control response to a step change in a mulitivariable control model on Simulink. The PID controllers and transfer functions are set out correctly, but no matter what initial value I set in the step blocks, the plotted responses will start from zero. I have seen that this can be fixed by using a state-space block instead, but I was wondering if there was an easier solution, as I am not too familiar with state-space control lol
  1 Comment
Sam Chak
Sam Chak on 13 Feb 2025
It is important to understand that the transfer function model is fundamentally derived from ordinary differential equations (ODEs), which can also be expressed in matrix form known as State-Space representation. Thus, if you have the transfer function model, then you must have known the ODEs of the system dynamics.
To the best of my recollection, we can assign starting values to the state variables only at the very beginning of the simulation if the model is in ODE or State-Space form. However, @MULI appears to have proposed different solutions. Please try them out and see if they work.

Sign in to comment.

Answers (1)

MULI
MULI on 13 Feb 2025
Edited: MULI on 13 Feb 2025
Hi @Jude,
You can set a nonzero initial value in Simulink by following below approaches:
  • Adjust the "Step" block parameters by setting the initial value to your desired starting point.
  • You can use an "IC" block before your system to define an initial output. You can refer to this documentation link for more information on this block https://www.mathworks.com/help/simulink/slref/ic.html
  • Verify whether the Transfer Function or PID Controller block has the correct Initial States or Integrator Initial Condition set.
  • You can also use an operating Point by configuring Model Configuration Parameters > Data Import/Export to set the Initial State.
These approaches will allow your system to start from a nonzero value.
  1 Comment
Sam Chak
Sam Chak on 13 Feb 2025
Hello @MULI
(1) Does setting the initial value in the Step block parameter allow the system's state variable to start at the specified value at the simulation start time?
(2) Additionally, I do not recall that the output of the Initial Condition (IC) block can be connected to the standard Transfer Fcn block.
Are these two new features introduced in the latest update to enhance the experience of System Dynamics users in Simulink? I have not updated yet. Could you please clarify these two items?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!