3
$\begingroup$

I was curious, and I used the built-in functions of Mathematica to analyze the following scheme:

I used SystemModelMerge as:

integrator = TransferFunctionModel[1/s, s];

sum1 = NonlinearStateSpaceModel[{{}, u1 + u2}, {}, {u1, u2}];

prod1 = NonlinearStateSpaceModel[{{}, u1 u2}, {}, {u1, u2}];

sum2 = NonlinearStateSpaceModel[{{}, u1 + u2}, {}, {u1, u2}];

prod2 = NonlinearStateSpaceModel[{{}, u1 u2}, {}, {u1, u2}];

n1 = NonlinearStateSpaceModel[{{}, u^2}, {}, {u}];

nsys = 
 SystemsModelMerge[
  SystemsConnectionsModel[{n1, prod1, sum1, integrator, sum2, 
    prod2}, {{1, 1} -> {2, 1}, {2, 1} -> {3, 1}, {3, 1} -> {4, 1}, {4,
       1} -> {6, 2}, {5, 1} -> {6, 1}, {6, 1} -> {1, 1}, {1, 1} -> {5,
       1}}, {{1, 1}, {3, 1}, {5, 1}}, {{1, 1}}]]

During evaluation of In[126]:= Control`ConnectionsDump`SystemsModelConnect::inputdef: -- Message text not found -- (4)

It did not work and it is not clear why. Most likely, a connection error.

Is there a way to improve the results using SystemModelMerge, or some other way that makes it easier to view multiply connected systems with multiple inputs? For example, in my case, $u_1$ is an arbitrary signal, and $u_2 = u_3 = 0.1 sin (10 t)$?

enter image description here

$\endgroup$
3
  • $\begingroup$ The error message appears to be coming from the SystemModelMerge command - I tried everything you wrote without that and don't see the error. $\endgroup$
    – Mark R
    Dec 18, 2019 at 20:07
  • $\begingroup$ I think your inputs should be {{2,1},{3,1},{5,1}}. $\endgroup$
    – Mark R
    Dec 18, 2019 at 20:16
  • $\begingroup$ You right. There is mistake in connection. Carelessness... $\endgroup$
    – dtn
    Dec 19, 2019 at 5:50

1 Answer 1

1
$\begingroup$

I think you have some mistakes in the specs, like the first input is {2, 2} and not {1, 1}, etc.

SystemsModelMerge[SystemsConnectionsModel[
  {n1, prod1, sum1, integrator, sum2, prod2}, 
  {{5, 1} -> {6, 1}, {6, 1} -> {1, 1}, {1, 1} -> {2, 1}, {2, 1} -> {3, 1}, 
       {3, 1} -> {4, 1}, {4, 1} -> {6, 2}, {1, 1} -> {5, 2}}, 
  {{2, 2}, {3, 2}, {5, 1}}, 
  {{1, 1}}]]

enter image description here

$\endgroup$
3
  • $\begingroup$ You right. I had an error in block connections. I need to be more careful. $\endgroup$
    – dtn
    Dec 19, 2019 at 5:51
  • $\begingroup$ NP. We all make such mistakes. Thanks to your example, the error message will be fixed in the next release. $\endgroup$ Dec 19, 2019 at 16:31
  • $\begingroup$ Please, see mathematica.stackexchange.com/questions/239610/… $\endgroup$
    – dtn
    Feb 8, 2021 at 19:24

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.