How to solve division by zero error ?

조회 수: 11 (최근 30일)
Priya
Priya 2014년 8월 13일
편집: Priya 2014년 8월 13일
Hi,
I have designed a model in Simulink and when I run the program it gives a warning and an error,
Warning: Division by zero in 'nl_hvm_sim/Lateral forces_FW/Lateral_force_left_wheel/Reciprocal Sqrt'
> In model_sim1 at 544
Warning: Division by zero in 'nl_hvm_sim/Lateral forces_FW/Lateral_force_right_wheel/Sqrt'
> In model_sim1 at 544
Warning: Division by zero in 'nl_hvm_sim/Yaw moments_FW /force_posvectors_Left /Sqrt'
> In model_sim1 at 544
Warning: Division by zero in 'nl_hvm_sim/Yaw moments_FW /force_posvectors_Right /Sqrt'
> In model_sim1 at 544
Warning: Division by zero in 'nl_hvm_sim/Lateral forces_RW /Lateral_force_left_wheel_RW /Reciprocal Sqrt'
> In model_sim1 at 544
Warning: Division by zero in 'nl_hvm_sim/Lateral forces_RW /Lateral_force_right_wheel_RW /Sqrt'
> In model_sim1 at 544
Warning: Division by zero in 'nl_hvm_sim/Yaw moments_RW /force_posvectors_Left /Sqrt'
> In model_sim1 at 544
Warning: Division by zero in 'nl_hvm_sim/Yaw moments_RW /force_posvectors_Right /Sqrt'
> In model_sim1 at 544
Error using model_sim1 (line 544)
Derivative input 1 of 'nl_hvm_sim/Lateral wheelset_F inertia /Integrator' at time 0.0 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 realize that the warning message has got something to do with the error. How to determine the point of origin of this error? Please do help.
Thanks.

답변 (1개)

Joakim Magnusson
Joakim Magnusson 2014년 8월 13일
I guess you are trying to calculate something by dividing with the time which at some point seem to be zero. Maybe it's not necessary to start your time at zero, maybe it can start at 10 or something. Sorry if i'm completely wrong but hard to understand with just your errors.
  댓글 수: 5
Joakim Magnusson
Joakim Magnusson 2014년 8월 13일
I think you will get a hard time getting any help without posting some code.
Priya
Priya 2014년 8월 13일
편집: Priya 2014년 8월 13일
I have attached a document which has the image of model but it is just a part of the whole model. Please let me know if you need more details about the model.
Thanks for your help.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Model Verification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by