Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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[]?

share|improve this question
Could you provide a minimum working example? – Rod Jul 2 '13 at 18:50
@ Rod LM :I edited my post and give an example. Hope you find it useful! – Shield Jul 2 '13 at 18:57
@user8364 But you forgot to put your definition for ssmModelC... the code is still not working. – Rod Jul 2 '13 at 18:59
@ 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! – Shield Jul 2 '13 at 19:04
This option would work Method -> {"NDSolve", MaxSteps -> value}, although undocumented. – Suba Thomas Jul 2 '13 at 20:31
up vote 4 down vote accepted

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\}$.

share|improve this answer
Thank you so much! It is absolutely perfect! – Shield Jul 3 '13 at 6:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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