I want to plot an output response from a state space model. I use StateResponse[] to calculate it and then plot it. When I run my code, I face this message:

NDSolve::mxst: Maximum number of 10000 steps reached at the point t == 0.007796405242565201`.

I do not even use NDSolve[] command to solve my equations! This is my code and its answer:

u = -kk.StateResponse[ssmModelC, UnitStep[t] , {t, 0, 10}]

How is it possible to increase number of steps in StateResponse[]?

  • $\begingroup$ Could you provide a minimum working example? $\endgroup$
    – Rod
    Jul 2, 2013 at 18:50
  • $\begingroup$ @ Rod LM :I edited my post and give an example. Hope you find it useful! $\endgroup$
    – Shield
    Jul 2, 2013 at 18:57
  • $\begingroup$ @user8364 But you forgot to put your definition for ssmModelC... the code is still not working. $\endgroup$
    – Rod
    Jul 2, 2013 at 18:59
  • $\begingroup$ @ Rod LM : Actually, ssmModelC is a 120*120 Matrix and 3 more huge matrixes, which build my space state model, and I can not put them here! The point is Maximum steps to calculate the response between 0 and 10 seconds! I have no idea to increase the number of steps! $\endgroup$
    – Shield
    Jul 2, 2013 at 19:04
  • 1
    $\begingroup$ This option would work Method -> {"NDSolve", MaxSteps -> value}, although undocumented. $\endgroup$ Jul 2, 2013 at 20:31

1 Answer 1


The MaxSteps option (or any other option to NDSolve) can be adjusted by specifying it as a suboption.

u = -kk.StateResponse[ssmModelC, UnitStep[t] , {t, 0, 10}, Method -> {"NDSolve", MaxSteps -> value}]

The only caveat is that it is not yet documented.

And regarding when NDSolve is used, pretty much when there is a continuous-time system and the time specification is of the form $\{t, tmin, tmax\}$.

  • $\begingroup$ Thank you so much! It is absolutely perfect! $\endgroup$
    – Shield
    Jul 3, 2013 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.