3
$\begingroup$

I am working using transfer functions models with Mathematica and i am missing a basic feature like the ability to use a Sum Block.

enter image description here

How could the model above be modeled?

Considering:

C = TransferFunctionModel[2];
P = TransferFunctionModel[1/(s + 2), s];

And noise being a generic signal like a sine wave or a constant noise.

$\endgroup$
2
  • 1
    $\begingroup$ Are you trying to run simulations in the time domain or in the frequency domain? I note that your transfer function is defined in the s plane. Are you after a simulation or a symbolic analysis? $\endgroup$
    – Hugh
    Commented Jan 8, 2021 at 10:50
  • $\begingroup$ I would like to run simulations in the time domain and do other tasks like transfer function shaping or stability studies in the Laplace Transform domain. $\endgroup$
    – zurg
    Commented Jan 8, 2021 at 11:16

1 Answer 1

1
$\begingroup$

There are many ways a sum block could be specified.

Directly:

sum = TransferFunctionModel[{{1, 1}}]

enter image description here

StateSpaceModel[{{}, {}, {}, {{1, 1}}}]

enter image description here

AffineStateSpaceModel[{{}, {}, {}, {{1, 1}}}, {}, {u1, u2}]

enter image description here

NonlinearStateSpaceModel[{{}, u1 + u2}, {}, {u1, u2}]

enter image description here

Or from the equation:

StateSpaceModel[{y[t] == u1[t] + u2[t]}, {y[t]}, {u1[t], u2[t]}, {y[t]}, t]

enter image description here

After that the complete system can be obtained using SystemsConnectionsModel and SystemsModelMerge:

c = TransferFunctionModel[2];
p = TransferFunctionModel[1/(s + 2), s];


SystemsConnectionsModel[{c, p, sum}, {{1, 1} -> {2, 1}, {2, 1} -> {3, 1}}, {{1, 1}, {3, 2}}, {{3, 1}}];
SystemsModelMerge[%]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you, i have to say that, while it is really simple, it's not easy to find on the docs. Now it is pretty clear. $\endgroup$
    – zurg
    Commented Jan 8, 2021 at 15:47

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.