How to read a signal with discontinuities from workspace in simulink?

5 Ansichten (letzte 30 Tage)
I have a standard validation signal and want to read it from workspace as the input of my model in Simulink and then compare the output of model with the one from measurements. As it is a validation signal I can not change the signal in order to remove the discontinuities. Whenever I try to run the model I receive a error regarding the singularity problems over the integrator blocks in my model, because of having discontinuities.
Derivative input 1 of 'laplace_domain_test_V2/ct & dl & Warburg/Integrator' at time 140.0042 is Inf or NaN. Stopping simulation. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
I tried to reduce the step size to very small values & tightening the error tolerance and also to change the solver to the stiff ones but the problem is still unfixed. Can any one please suggest a way to get rid of this error?
I really appreciate your help in advance!

Akzeptierte Antwort

Sara Mohajer
Sara Mohajer am 30 Jul. 2014
Hi Fernando,
Thanks a lot for your answer. Actually the part of my model that has the problem with singularity is a parallel RL circuit, the input is current and the output is voltage. For the input a standard validation signal is used for test of batteries. I tried to check the signals in every step, but the problem is still unclear to me. Actually it is highly dependent on the value of inductor. As it gets larger to 100 times larger in order of magnitude the model works fine. But in my actual model the inductor is in the order of 2e-8 (H). Taht is really weird for me. I have attached the file, can you please kindly have a look at it.

Weitere Antworten (1)

Fernando
Fernando am 29 Jul. 2014
Normally the problems I've encountered with that error were indeed caused by an Inf or NaN being sent to the integrator. Check if there's a chance of that happening in your model. Scope all signals forming the integrand individually to see whether you have a division by zero or you are getting a NaN due to a block initialization, etc. Depending on your differential equation arrangement, disconnecting the integrator and inspecting its input signal might give you a clue.

Community Treasure Hunt

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

Start Hunting!

Translated by