Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Derivative input at time xxx is Inf or Nan

Subject: Derivative input at time xxx is Inf or Nan

From: venkata ragavan

Date: 4 Jan, 2009 17:46:02

Message: 1 of 6

Hi,

I get the following error while i try to run my simulation.
I have also tried using a memory block in the feedback line as suggested in few threads but it did not change the result. Pls do drop in your suggestions.

??? Derivative input 1 of 'LinearModel/Plant/Electrical/Integrator1' at time 0.002875 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).

Thank you,
Venkat

Subject: Derivative input at time xxx is Inf or Nan

From: Rune Allnor

Date: 4 Jan, 2009 17:52:19

Message: 2 of 6

On 4 Jan, 18:46, "venkata ragavan " <meetraga...@gmail.com> wrote:
> Hi,
>
> I get the following error while i try to run my simulation.
> I have also tried using a memory block in the feedback line as suggested in few threads but it did not change the result. Pls do drop in your suggestions.

What do you not understand? The message? Or what to do with it?

If you don't know what a 'singularity' is, it is a bad numerical
condition which essentially means that the computations break
down. One example is divisions by 0, but there are many others.

The way to handle this problem is to find out where and why
it occurs, and if possible, restate the simulation to handle
this singularity.

This means that you need to investigate the simulation in
minute detail and find out where the problems occur. And
yes, *you* have to do that, since you are the only person
to have access to your models.

Rune

Subject: Derivative input at time xxx is Inf or Nan

From: Roger Stafford

Date: 5 Jan, 2009 01:05:04

Message: 3 of 6

"venkata ragavan " <meetragavan@gmail.com> wrote in message <gjqskq$57r$1@fred.mathworks.com>...
> Hi,
>
> I get the following error while i try to run my simulation.
> I have also tried using a memory block in the feedback line as suggested in few threads but it did not change the result. Pls do drop in your suggestions.
>
> ??? Derivative input 1 of 'LinearModel/Plant/Electrical/Integrator1' at time 0.002875 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).
>
> Thank you,
> Venkat

  I have no way of knowing the details of your simulation. I do know that if your derivative is approximated by finite differences and if your step size happens to be exactly zero, you will get a zero divided by zero situation which produces a NaN:

 f'(x) = (approx) (f(x+a)-f(x))/a = 0/0 --> NaN

when a equals zero.

Roger Stafford

Subject: Derivative input at time xxx is Inf or Nan

From: Alexander

Date: 14 Feb, 2009 21:38:01

Message: 4 of 6

"venkata ragavan " <meetragavan@gmail.com> wrote in message <gjqskq$57r$1@fred.mathworks.com>...
> Hi,
>
> I get the following error while i try to run my simulation.
> I have also tried using a memory block in the feedback line as suggested in few threads but it did not change the result. Pls do drop in your suggestions.
>
> ??? Derivative input 1 of 'LinearModel/Plant/Electrical/Integrator1' at time 0.002875 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).
>
> Thank you,
> Venkat

I've had the same error and didn't realise that the output was just to big so the Inf error was thrown. For example set the simulation time to 0.0028 and see if the output isn't to big.

-alex

Subject: Derivative input at time xxx is Inf or Nan

From: Hilda Hilda

Date: 23 May, 2011 04:11:04

Message: 5 of 6


> > ??? Derivative input 1 of 'LinearModel/Plant/Electrical/Integrator1' at time 0.002875 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).
> >
> > Thank you,
> > Venkat
  

I'm also getting the same error at some point in my simulation. Have realized it is due to the times when my input is zero, yet it is inevitable because my input is actually solar irradiance, and must be zero during some points. What should i do about it?
Thank you ,
Hilda

Subject: Derivative input at time xxx is Inf or Nan

From: user

Date: 1 Jun, 2011 08:02:02

Message: 6 of 6

"Hilda Hilda" wrote in message <ircmoo$a1m$1@newscl01ah.mathworks.com>...
>
> > > ??? Derivative input 1 of 'LinearModel/Plant/Electrical/Integrator1' at time 0.002875 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).
> > >
> > > Thank you,
> > > Venkat
>
>
> I'm also getting the same error at some point in my simulation. Have realized it is due to the times when my input is zero, yet it is inevitable because my input is actually solar irradiance, and must be zero during some points. What should i do about it?
> Thank you ,
> Hilda

Hi,
You can try different solvers in configuration parameters.

HTH,
saif

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us