Block 'untitled/单边磁拉力模块/Math Function1' outputs 'Inf' for element 1 of output port 1 at major time step 0.0009
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens

Hello! I have built a motor simulation circuit, and I encounter an error when running it, as shown in the image. I have been unable to find a solution. Could you please help me identify the problem and suggest how to resolve it? Thank you!
2 commentaires
Réponses (1)
Sahas
le 16 Déc 2024
I was able to reproduce the error and as per my understanding, it is coming due to some numerical unstability or overflow. The solver cannot perform the computation because the value is either extremely large or extremely small. You can debug the model by setting a different step size and "Step Forward" the simulation to see the Port Values.

You can also try out the possible workarounds given below:
- Try out different Solver settings by opening the pressing "Ctrl+E" and opening the "Model Settings" pane. Select a more "stiff solver" such as ode15s, ode23s; reduce the relative error tolerance; reduce the maximum and minimum step size. Altenatively, you can also set all the parameters to "auto".
- Break your model into different parts and debug each part individually to see where the numerics go out of bounds.
- Resolve the Warnings first as the "Derivative" block could generate inf values.
Hope this helps you out!
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!