I am trying to follow the documentation on NonlinearStateSpaceModel here, and the first basic example throws me for a loop. It says it's defining the nonlinear system



with output $y(t)=x_1(t)$

The example call is written

nsys = NonlinearStateSpaceModel[{{u-x1 x2, u x2+1}, {x1}}, {x1, x2}, u]

This appears to be the arity-3 overload for NonlinearStateSpaceModel, which, if right, must fit the template


representing the model

$x'(t)=f(x(t), u(t)), y(t)=g(x(t),u(t))$

That means that

$x$ is {x1, x2}

$f$ is {u - x1*x2, u*x2 + 1}

$g$ is {x1}

which I can only read as



with output $y(t)=x_1(t)$

which doesn't look anything like the system they say they're defining. I've blinked my eyes several times and stared at it for too long. It's either a horrendous cluster of typos or I just don't know how to read these models.

  • 1
    $\begingroup$ think you're right. Their input does not fit the description. $\endgroup$ – Phab Sep 2 '14 at 10:33
  • 1
    $\begingroup$ The example text has a couple of typos. It should read $\ldots x_1'(t)=u(t)-x_1(t) x_2(t), x_2'(t)=u(t) x_2(t)+1 \ldots$ $\endgroup$ – Suba Thomas Sep 3 '14 at 3:16

For this description: enter image description here

The input should be

nsys = NonlinearStateSpaceModel[{{u + Subscript[x, 1] Subscript[x, 2],
 u Subscript[x, 2]}, {Subscript[x, 1]}}, {Subscript[x, 1], Subscript[x, 2]}, u]

and so the result would be

enter image description here

  • $\begingroup$ Your opinion, then, is that the original must be a cluster of typos? $\endgroup$ – Reb.Cabin Sep 2 '14 at 16:20
  • 1
    $\begingroup$ Yes, I would say so. Either the text or the code is wrong. They do not match. $\endgroup$ – Phab Sep 3 '14 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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