Inf NaN error

Discussion in 'Math' started by nlsafura88, Apr 12, 2012.

  1. nlsafura88

    Thread Starter New Member

    Apr 12, 2012
    I am currently trying to run a program from m file to be implemented in matlab/simulink model..
    However, when I try to run the program, the error such as below came out

    ??? Error using ==> tracklsq_4 at 12
    Derivative input 1 of 'optsim_4/Integrator' at time 7.2 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).

    Error in ==> PSO_4 at 44
    current_fitness(i) = tracklsq_4(current_position:),i));

    Does anyone know why this is happened?
    I've try to play around with several parameters in 'configuration parameters', but it still doesn't work..

    Since I am new to this field,
    I would be very appreciate if someone can help me or give me some suggestions for this problem..
    The file is attached for those who would like to fix this problem..
    Thanks.. :)
    Last edited: Apr 12, 2012
  2. panic mode

    Senior Member

    Oct 10, 2011
    obviously it does not like the value. you need to track it down and see what does it. you can place breakpoints and/or run in steps until you narrow it down on culprit.