# System model merge with multiple input and one output

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]:= ControlConnectionsDumpSystemsModelConnect::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)$$?

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

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}}]]


• You right. I had an error in block connections. I need to be more careful.
– dtn
Dec 19, 2019 at 5:51
• NP. We all make such mistakes. Thanks to your example, the error message will be fixed in the next release. Dec 19, 2019 at 16:31
• – dtn
Feb 8, 2021 at 19:24