Simscape integrator is not working properly
9 views (last 30 days)
When i was working on a project with simscape (matlab v: r2012b) .ssc files i have realized that the simscape equation for taking an integral of signal like:
x.der == input_signal;
output_signal == x;
is not taking the proper integral. To show this i have decided to use both of the simulink and simscape integrator blocks for the same signal to show there is a problem with the simscape integration
the part of the simulink test blocks:
and the output signals. on the left is the simscape integrator output a constant value 5.3776x10e4. Scope on the right is the simulink output that looks normal:
i have also tried to change solver conf settings or PS/S output signal types and nope nothing change!
Ryan G on 16 Jul 2013
From this page:
Finding an Initial Steady State When you select the Start simulation from steady state check box, the solver attempts to find the steady state that would result if the inputs to the system were held constant for a long enough time, starting from the initial state obtained from the initial conditions computation just described. If the steady-state solve succeeds, the state found is some steady state (within tolerance), but not necessarily the state expected from the given initial conditions. Steady state means that the system variables are no longer changing with time. Simulation then starts from this steady state.
So what's happening is, with simscape, the solver is grouping that integrator with the physical system. When that box is checked it's 'running' the simulation for a long time and determining the initial condition of the integrator based on that result, overriding the initial condition you input.
Simulink is not part of the 'physical system' and as a result is not effected by what the solver config is doing.
Steady-state for the integrator would mean that dx/dt of the state is 0. This can only happen once the input to the integrator is 0. If this condition does not occur with your current setup, then you cannot achieve steady state for this particular block. That is why the value is so large. One way to test this is to manually run the simulation for a long time, does it reach steady state? If not you need to modify parameters that would allow it to achieve this. If you have Simulink Control Design, you can use the linearization tool to find a trim (steady state) condition.