1
$\begingroup$

enter image description here

Given the following equation. How can I run this in mathematica and get the same result?

I naively tried it like this, with:

A = {{0, 1}, {0, 0}}
b = {0, 1}
x = {x1, x2}
p = {p1, p2}
u = u

and

  1 + p.(A.x + b.u)

which results in

1 + p2 {0, 1}.u + p1 (x2 + {0, 1}.u)

or

1 + p.(A*x + b*u)

which results in

{1 + p2 u, 1 + p2 u + p1 x1}

which is also wrong. In short, I don't get it somehow, can anybody help me out here?

$\endgroup$
  • $\begingroup$ Vector x should be transposed $\endgroup$ – gapolo Oct 17 '17 at 18:18
5
$\begingroup$
1+p.(A.x + b*u)

Use . for matrix multiplication or vector dot products. Use * for element-wise scalar product. Since u is a scalar, use * to multiply it with the vector b.

$\endgroup$
  • $\begingroup$ works, thank you! :) $\endgroup$ – holistic Oct 17 '17 at 18:18

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.