MATLAB: Error while using derivative

errorMATLABsimulationsimulinksolve

Hello, I'm getting the following error while trying to compute my simulation. I've tried to change the solver but I didn't really help. The problem is that this model do actually work on Matlab 2009b, but it fails to compute on Matlab 2017a, which is my objective. Could you possibly help me with this error?
Error using test7_poscig_a (line 20)
Simulink cannot solve the algebraic loop containing 'Metody_test7_a/Derivative3' at time
5.4656330917168992E-8 using the TrustRegion-based algorithm due to one of the following
reasons: the model is ill-defined i.e., the system equations do not have a solution; or the
nonlinear equation solver failed to converge due to numerical issues.
To rule out solver convergence as the cause of this error, either
a) switch to LineSearch-based algorithm using
set_param('Metody_test7_a','AlgebraicLoopSolver','LineSearch')
b) reducing the ode113 solver RelTol parameter so that the solver takes smaller time
steps.
If the error persists in spite of the above changes, then the model is likely ill-defined and
requires modification.

Best Answer

Change your step size accordingly to obtain a valid solution. Check your derivative signal's rise time in a given interval(for instance in 0.01 seconds). Then your aim should be to capture the fast rise of the signal, therefore try to select your step size smaller than the signal's rise time(for instance 0.001 seconds). Use a fixed step solver.
Related Question