- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 OpenModelica 中创建了一个模型,该模型使用插值表组装状态空间矩阵。矩阵是使用一个表创建的,该表接受一个输入和 39 个输出(13 个特征值、13 个系统输入和 13 个系统输出)。我可以很好地组装矩阵,但是在将它们分配给状态空间 block 时出现以下错误:
[ZapuniInterpolation: 53:52-53:57]: Component A of variability parameter has binding 'ssA' of higher variability continuous.
模型由以下代码给出:
block ZapuniInterpolation
// ----------------------------------------------------------------------------- //
Modelica.Blocks.Tables.CombiTable1Ds modelDef(table = [180.0, 0.0, 0.125639618, 0.122496368, 0.152595123, 1.30134654, 7.03518772, 10.1638193, 11.777113, 12.5243101, 21.683424, 27.5360508, 34.4655838, 34.1353836, -0.000156808334, 0.000567958435, -6.16513252e-06, 5.07716331e-05, 0.000295116516, -0.00226303029, 1.72715359e-05, -2.76345825e-05, -0.000384722595, -1.60172176e-05, 2.38217144e-05, 8.43528748e-06, 2.26263523e-05, -0.0392020416, -0.0412239838, 0.000444312775, -0.00735736036, 0.083243988, 0.00416324186, 0.00528137589, -0.012360487, 1.24845228e-05, -0.196934738, 6.53376694e-05, -7.1772345e-07, -0.047993618; 182.5, 0.0, 0.12338031, 0.121614441, 0.152516403, 1.28446889, 7.03372765, 10.160368, 11.7592869, 12.5243101, 24.4601326, 27.5334625, 34.4655838, 32.8034935, -0.000155028641, 0.000569061768, -1.06752777e-05, 4.43576736e-05, 0.000292540131, -0.00226327395, 1.87270737e-05, -2.94425335e-05, -0.000384721771, -1.95333481e-05, 2.38186722e-05, 8.43502998e-06, 2.18605156e-05, -0.038757122, -0.0399122047, 0.000745555359, -0.00661621618, 0.080380722, 0.00384176278, 0.00474613094, -0.010696907, 1.03946018e-05, -0.187355469, 0.000304825897, -3.04758026e-07, -0.0856405334; 185.0, 0.0, 0.121165268, 0.120708992, 0.152441833, 1.26705885, 7.03220701, 10.1565781, 11.7394562, 12.5243101, 26.2911625, 27.5308762, 34.4655838, 33.3992195, -0.000153284882, 0.000568685425, -4.0209774e-05, 3.89236832e-05, 0.000290123566, -0.00226349735, 2.0346014e-05, -3.14919395e-05, -0.000384720856, -2.75364189e-05, 2.39696522e-05, 8.43503952e-06, 1.46955872e-05, -0.0383211823, -0.0385091896, 0.00271969485, -0.00597921848, 0.0775424423, 0.00357709074, 0.00436138248, -0.00955755329, 8.97015572e-06, -0.137678406, 0.000970456665, -8.64766174e-07, -0.156308731; 187.5, 0.0, 0.118988342, 0.119786552, 0.152369507, 1.24918771, 7.0306282, 10.1524391, 11.7177658, 12.5243092, 26.049839, 27.5282478, 34.4655838, 37.3313332, -0.000151576111, 0.000570432922, 2.22414017e-05, 3.42602654e-05, 0.000287870667, -0.00226369929, 2.21327553e-05, -3.37703247e-05, -0.000384719849, -3.28333435e-05, 2.40614624e-05, 8.43494415e-06, 6.49287128e-06, -0.0378939934, -0.0372608452, -0.00145591199, -0.00542455482, 0.074719574, 0.00335672474, 0.00408232164, -0.00875357533, 7.95372009e-06, -0.080245285, 0.000683899231, 4.3715094e-07, -0.196699677; 190.0, 0.0, 0.116858894, 0.118837822, 0.152297958, 1.23091626, 7.02899122, 10.1479139, 11.6941319, 12.5243092, 24.9532948, 27.5255089, 34.4655838, 43.7087631, -0.000149901413, 0.000571410095, 8.67566872e-06, 3.02129364e-05, 0.000285783508, -0.00226387715, 2.41047344e-05, -3.62895241e-05, -0.000384718781, -3.62359619e-05, 2.40104408e-05, 8.43495083e-06, 3.14631987e-06, -0.0374753189, -0.0359707489, -0.000549157532, -0.0049361062, 0.0719031982, 0.00317143512, 0.00388165021, -0.00817939949, 7.20596743e-06, -0.0537428932, 0.000341564392, 1.62058945e-07, -0.2088992; 195.0, 0.0, 0.112727142, 0.116876053, 0.152152176, 1.19337523, 7.02551937, 10.1374197, 11.639926, 12.5243092, 22.4547005, 27.5198441, 34.4655838, 63.5006485, -0.000146650772, 0.000572308289, 3.85471559e-06, 2.35291004e-05, 0.000282106537, -0.00226414824, 2.87340622e-05, -4.21810608e-05, -0.00038471637, -4.2829483e-05, 2.39550076e-05, 8.43493652e-06, 1.15650666e-06, -0.0366626587, -0.0333576317, -0.00022747081, -0.0041120615, 0.0662582474, 0.0028797617, 0.00365292263, -0.00749141979, 6.22078133e-06, -0.0335395622, 0.00014459668, 7.19030685e-08, -0.2181745; 200.0, 0.0, 0.10876281, 0.114828865, 0.151995438, 1.15478432, 7.02172279, 10.1242056, 11.5731678, 12.5243082, 20.1688595, 27.5138836, 34.4655838, 97.7778931, -0.000143526184, 0.000572750549, 2.4388926e-06, 1.82274666e-05, 0.000279082581, -0.00226427436, 3.46423569e-05, -4.95841827e-05, -0.000384713623, -5.03695107e-05, 2.39311123e-05, 8.4349184e-06, 1.23468935e-06, -0.0358815079, -0.030764555, -0.000133495087, -0.00343931985, 0.0605537033, 0.00266271996, 0.00360132694, -0.00721686459, 5.66029549e-06, -0.0255758495, 8.98340149e-05, 4.8260746e-08, -0.220523834]) annotation(
Placement(visible = true, transformation(origin = { 0, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// ----------------------------------------------------------------------------- //
Real [13] omega2={modelDef.y[1], modelDef.y[2], modelDef.y[3], modelDef.y[4], modelDef.y[5], modelDef.y[6], modelDef.y[7], modelDef.y[8], modelDef.y[9], modelDef.y[10], modelDef.y[11], modelDef.y[12], modelDef.y[13]};
// ------
Real [13] Ba={modelDef.y[14], modelDef.y[15], modelDef.y[16], modelDef.y[17], modelDef.y[18], modelDef.y[19], modelDef.y[20], modelDef.y[21], modelDef.y[22], modelDef.y[23], modelDef.y[24], modelDef.y[25], modelDef.y[26]};
// ------
Real [13] Ca={modelDef.y[27], modelDef.y[28], modelDef.y[29], modelDef.y[30], modelDef.y[31], modelDef.y[32], modelDef.y[33], modelDef.y[34], modelDef.y[35], modelDef.y[36], modelDef.y[37], modelDef.y[38], model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0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1;
- omega2[1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, - omega2[2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, - omega2[3], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[3], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, - omega2[4], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[4], 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, - omega2[5], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[5], 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, - omega2[6], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[6], 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, - omega2[7], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[7], 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, - omega2[8], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[8], 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, - omega2[9], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[9], 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, - omega2[10], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[10], 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - omega2[11], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[11], 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - omega2[12], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[12], 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - omega2[13], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[13] ];
// ------
Real [26, 1] ssB = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; Ba[1]; Ba[2]; Ba[3]; Ba[4]; Ba[5]; Ba[6]; Ba[7]; Ba[8]; Ba[9]; Ba[10]; Ba[11]; Ba[12]; Ba[13]];
// ------
Real [3, 26] ssC = [Ca[1], Ca[2], Ca[3], Ca[4], Ca[5], Ca[6], Ca[7], Ca[8], Ca[9], Ca[10], Ca[11], Ca[12], Ca[13], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
Ba[1], Ba[2], Ba[3], Ba[4], Ba[5], Ba[6], Ba[7], Ba[8], Ba[9], Ba[10], Ba[11], Ba[12], Ba[13], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Ba[1], Ba[2], Ba[3], Ba[4], Ba[5], Ba[6], Ba[7], Ba[8], Ba[9], Ba[10], Ba[11], Ba[12], Ba[13] ];
// ------
Real [3, 1] ssD = [0;
0;
0];
// ----------------------------------------------------------------------------- //
Modelica.Blocks.Interfaces.RealInput tableInput annotation(
Placement(visible = true, transformation(origin = {-60, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-60, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Modelica.Blocks.Continuous.StateSpace stateSpace(A=ssA, B=ssB, C=ssC, D=ssD, initType = Modelica.Blocks.Types.Init.NoInit) annotation(
Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput out1 annotation(
Placement(visible = true, transformation(origin = {50, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {50, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput out2 annotation(
Placement(visible = true, transformation(origin = {50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput out3 annotation(
Placement(visible = true, transformation(origin = {50, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {50, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput ssInput annotation(
Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
equation
// ----------------------------------------------------------------------------- //
connect(modelDef.u, tableInput) annotation(
Line(points = {{-12, 40}, {-60, 40}}, color = {0, 0, 127}));
connect(stateSpace.y[1], out1) annotation(
Line(points = {{12, 0}, {20, 0}, {20, 20}, {50, 20}, {50, 20}}, color = {0, 0, 127}));
connect(stateSpace.y[2], out2) annotation(
Line(points = {{12, 0}, {42, 0}, {42, 0}, {50, 0}}, color = {0, 0, 127}));
connect(stateSpace.y[3], out3) annotation(
Line(points = {{12, 0}, {20, 0}, {20, -20}, {50, -20}, {50, -20}}, color = {0, 0, 127}));
connect(stateSpace.u[1], ssInput) annotation(
Line(points = {{-12, 0}, {-60, 0}}, color = {0, 0, 127}));
// ----------------------------------------------------------------------------- //
annotation(
uses(Modelica(version = "3.2.3")));
end ZapuniInterpolation;
现在我显然可以将所有 Real 声明更改为 parameter Real,这解决了 State-Space 模块的问题。然而,我无法根据插值表定义数组omega2、Ba、Ca:然后发生以下错误
[ZapuniInterpolationTest: 6:3-6:229]: Component omega2 of variability parameter has binding '{modelDef.y[1], modelDef.y[2], modelDef.y[3], modelDef.y[4], modelDef.y[5], modelDef.y[6], modelDef.y[7], modelDef.y[8], modelDef.y[9], modelDef.y[10], modelDef.y[11], modelDef.y[12], modelDef.y[13]}' of higher variability continuous.
所以我的问题是,如何使用插值表定义矩阵并在 State-Space 模块中使用它们?
最佳答案
如果我对您的示例的理解正确,您希望使用输入通过用于插值的表来计算系统矩阵的系数。这将导致 ssA
成为变量。
根本问题是 Modelica.Blocks.Continuous.StateSpace
的参数与变量相比具有较低的可变性。参数在模拟过程中是恒定的,而变量会随时间变化。在 Modelica 中,不可能将一个表达式分配给另一个具有较低可变性的表达式。有关这方面的更多信息,请参阅 Modelica Language Specification ,第 3.8 节。
有两种解决方法
A
、B
、C
、D
限制的状态空间 block 作为参数。我认为从技术上讲它不再是状态空间,但那是吹毛求疵...选项 1. 似乎对您没有帮助,所以我将跳过它。
选项 2. 应该可以通过直接在模型中添加状态空间方程来实现。这应该是
der(x) = ssA*x + ssB*{ssInput};
y = ssC*x + ssD*{ssInput};
out1 = y[1];
out2 = y[2];
out3 = y[3];
针对您的情况。此外,您还需要使用
定义x
和
y
Real x[size(ssA,1)] "states";
Real y[size(ssC,1)] "outputs";
并删除状态空间 block (及其连接)的原始定义。
这应该导致整体代码:
block ZapuniInterpolation
// ----------------------------------------------------------------------------- //
Modelica.Blocks.Tables.CombiTable1Ds modelDef(table = [180.0, 0.0, 0.125639618, 0.122496368, 0.152595123, 1.30134654, 7.03518772, 10.1638193, 11.777113, 12.5243101, 21.683424, 27.5360508, 34.4655838, 34.1353836, -0.000156808334, 0.000567958435, -6.16513252e-06, 5.07716331e-05, 0.000295116516, -0.00226303029, 1.72715359e-05, -2.76345825e-05, -0.000384722595, -1.60172176e-05, 2.38217144e-05, 8.43528748e-06, 2.26263523e-05, -0.0392020416, -0.0412239838, 0.000444312775, -0.00735736036, 0.083243988, 0.00416324186, 0.00528137589, -0.012360487, 1.24845228e-05, -0.196934738, 6.53376694e-05, -7.1772345e-07, -0.047993618; 182.5, 0.0, 0.12338031, 0.121614441, 0.152516403, 1.28446889, 7.03372765, 10.160368, 11.7592869, 12.5243101, 24.4601326, 27.5334625, 34.4655838, 32.8034935, -0.000155028641, 0.000569061768, -1.06752777e-05, 4.43576736e-05, 0.000292540131, -0.00226327395, 1.87270737e-05, -2.94425335e-05, -0.000384721771, -1.95333481e-05, 2.38186722e-05, 8.43502998e-06, 2.18605156e-05, -0.038757122, -0.0399122047, 0.000745555359, -0.00661621618, 0.080380722, 0.00384176278, 0.00474613094, -0.010696907, 1.03946018e-05, -0.187355469, 0.000304825897, -3.04758026e-07, -0.0856405334; 185.0, 0.0, 0.121165268, 0.120708992, 0.152441833, 1.26705885, 7.03220701, 10.1565781, 11.7394562, 12.5243101, 26.2911625, 27.5308762, 34.4655838, 33.3992195, -0.000153284882, 0.000568685425, -4.0209774e-05, 3.89236832e-05, 0.000290123566, -0.00226349735, 2.0346014e-05, -3.14919395e-05, -0.000384720856, -2.75364189e-05, 2.39696522e-05, 8.43503952e-06, 1.46955872e-05, -0.0383211823, -0.0385091896, 0.00271969485, -0.00597921848, 0.0775424423, 0.00357709074, 0.00436138248, -0.00955755329, 8.97015572e-06, -0.137678406, 0.000970456665, -8.64766174e-07, -0.156308731; 187.5, 0.0, 0.118988342, 0.119786552, 0.152369507, 1.24918771, 7.0306282, 10.1524391, 11.7177658, 12.5243092, 26.049839, 27.5282478, 34.4655838, 37.3313332, -0.000151576111, 0.000570432922, 2.22414017e-05, 3.42602654e-05, 0.000287870667, -0.00226369929, 2.21327553e-05, -3.37703247e-05, -0.000384719849, -3.28333435e-05, 2.40614624e-05, 8.43494415e-06, 6.49287128e-06, -0.0378939934, -0.0372608452, -0.00145591199, -0.00542455482, 0.074719574, 0.00335672474, 0.00408232164, -0.00875357533, 7.95372009e-06, -0.080245285, 0.000683899231, 4.3715094e-07, -0.196699677; 190.0, 0.0, 0.116858894, 0.118837822, 0.152297958, 1.23091626, 7.02899122, 10.1479139, 11.6941319, 12.5243092, 24.9532948, 27.5255089, 34.4655838, 43.7087631, -0.000149901413, 0.000571410095, 8.67566872e-06, 3.02129364e-05, 0.000285783508, -0.00226387715, 2.41047344e-05, -3.62895241e-05, -0.000384718781, -3.62359619e-05, 2.40104408e-05, 8.43495083e-06, 3.14631987e-06, -0.0374753189, -0.0359707489, -0.000549157532, -0.0049361062, 0.0719031982, 0.00317143512, 0.00388165021, -0.00817939949, 7.20596743e-06, -0.0537428932, 0.000341564392, 1.62058945e-07, -0.2088992; 195.0, 0.0, 0.112727142, 0.116876053, 0.152152176, 1.19337523, 7.02551937, 10.1374197, 11.639926, 12.5243092, 22.4547005, 27.5198441, 34.4655838, 63.5006485, -0.000146650772, 0.000572308289, 3.85471559e-06, 2.35291004e-05, 0.000282106537, -0.00226414824, 2.87340622e-05, -4.21810608e-05, -0.00038471637, -4.2829483e-05, 2.39550076e-05, 8.43493652e-06, 1.15650666e-06,
-0.0366626587, -0.0333576317, -0.00022747081, -0.0041120615, 0.0662582474, 0.0028797617, 0.00365292263, -0.00749141979, 6.22078133e-06, -0.0335395622, 0.00014459668, 7.19030685e-08, -0.2181745; 200.0, 0.0, 0.10876281, 0.114828865, 0.151995438, 1.15478432, 7.02172279, 10.1242056, 11.5731678, 12.5243082, 20.1688595, 27.5138836, 34.4655838, 97.7778931, -0.000143526184, 0.000572750549, 2.4388926e-06, 1.82274666e-05, 0.000279082581, -0.00226427436, 3.46423569e-05, -4.95841827e-05, -0.000384713623, -5.03695107e-05, 2.39311123e-05, 8.4349184e-06, 1.23468935e-06, -0.0358815079, -0.030764555, -0.000133495087, -0.00343931985, 0.0605537033, 0.00266271996, 0.00360132694, -0.00721686459, 5.66029549e-06, -0.0255758495, 8.98340149e-05, 4.8260746e-08, -0.220523834]) annotation (
Placement(visible = true, transformation(origin = { 0, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// ----------------------------------------------------------------------------- //
Real [13] omega2={modelDef.y[1], modelDef.y[2], modelDef.y[3], modelDef.y[4], modelDef.y[5], modelDef.y[6], modelDef.y[7], modelDef.y[8], modelDef.y[9], modelDef.y[10], modelDef.y[11], modelDef.y[12], modelDef.y[13]};
// ------
Real [13] Ba={modelDef.y[14], modelDef.y[15], modelDef.y[16], modelDef.y[17], modelDef.y[18], modelDef.y[19], modelDef.y[20], modelDef.y[21], modelDef.y[22], modelDef.y[23], modelDef.y[24], modelDef.y[25], modelDef.y[26]};
// ------
Real [13] Ca={modelDef.y[27], modelDef.y[28], modelDef.y[29], modelDef.y[30], modelDef.y[31], modelDef.y[32], modelDef.y[33], modelDef.y[34], modelDef.y[35], modelDef.y[36], modelDef.y[37], modelDef.y[38], modelDef.y[39]};
// ------
Real [13] damping={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// ----------------------------------------------------------------------------- //
Real [26, 26] ssA = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0;
0, 0, 0,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, 0, 0, 0, damping[8], 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, - omega2[9], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[9], 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, - omega2[10], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[10], 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - omega2[11], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[11], 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - omega2[12], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[12], 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - omega2[13], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, damping[13]];
// ------
Real [26, 1] ssB = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; Ba[1]; Ba[2]; Ba[3]; Ba[4]; Ba[5]; Ba[6]; Ba[7]; Ba[8]; Ba[9]; Ba[10]; Ba[11]; Ba[12]; Ba[13]];
// ------
Real [3, 26] ssC = [Ca[1], Ca[2], Ca[3], Ca[4], Ca[5], Ca[6], Ca[7], Ca[8], Ca[9], Ca[10], Ca[11], Ca[12], Ca[13], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
Ba[1], Ba[2], Ba[3], Ba[4], Ba[5], Ba[6], Ba[7], Ba[8], Ba[9], Ba[10], Ba[11], Ba[12], Ba[13], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Ba[1], Ba[2], Ba[3], Ba[4], Ba[5], Ba[6], Ba[7], Ba[8], Ba[9], Ba[10], Ba[11], Ba[12], Ba[13]];
// ------
Real [3, 1] ssD = [0; 0; 0];
// ----------------------------------------------------------------------------- //
Modelica.Blocks.Interfaces.RealInput tableInput annotation (
Placement(visible = true, transformation(origin = {-60, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-60, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput out1 annotation (
Placement(visible = true, transformation(origin = {50, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {50, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput out2 annotation (
Placement(visible = true, transformation(origin = {50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput out3 annotation (
Placement(visible = true, transformation(origin = {50, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {50, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput ssInput annotation (
Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-60, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Real x[size(ssA,1)] "states";
Real y[size(ssC,1)] "outputs";
equation
der(x) = ssA*x + ssB*{ssInput};
y = ssC*x + ssD*{ssInput};
out1 = y[1];
out2 = y[2];
out3 = y[3];
// ----------------------------------------------------------------------------- //
connect(modelDef.u, tableInput) annotation (
Line(points = {{-12, 40}, {-60, 40}}, color = {0, 0, 127}));
// ----------------------------------------------------------------------------- //
annotation (
uses(Modelica(version = "3.2.3")));
end ZapuniInterpolation;
不确定是否一切都按预期工作,因为输入为零(而且我不了解实际模型)。但它应该至少能让你继续下去。
与 MSL 的状态空间 block 相比,一个限制是不可能有初始条件。
关于modelica - 在 State-Space block OpenModelica 中使用连续变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62044084/
我正在编写一个简单的有限状态机,并意识到在某些情况下,事件可以将状态变为多个可能的结果。基本上,从状态 A,如果事件 E 发生,状态可能是 C 或 D。 我目前正在使用此处编写的 Javascript
我在 React 中构建了一个应用程序,我在其中一个样板项目中找到了一行。 (state = {}) => state 谁能给我解释一下上面这行是什么意思?它是 javascript ES6 标准。
如何将多个状态变量组合成另一个? 我想通过一些用户交互来更改高度或宽度的值,并相应地更新 View 中的所有内容。所以高度或宽度会改变,面积也会改变。 我想它看起来像这样 @State var wid
我的容器正在通过 redux store 获取状态。 我通过这样的 Prop 将这个状态传递给模态框:示例: render(){ let {team,id} =this.props.data;
您好,我正在尝试使用 map 根据我所在状态的数组渲染选项,但在返回中使用它时我得到未定义 这是数组 this.state = { countries: ["Australia","Brazil"
我想将 this.state.currentPlayer 分配给 this.state.whosPlaying。它抛出错误TypeError:无法读取新板上未定义的属性“currentPlayer”。
我正在实现某种动态工作流程,当达到某个点时,我必须重新加载状态以呈现 HTML 并重新实例化 Controller 才能继续。 我发现我第二次调用 $state.reload() 不起作用。这是期望的
我正在开发一个 flutter 应用程序,并发现状态管理出现意外行为。我创建了一个示例应用来重现该行为,您可以在下面找到代码和日志输出。 该应用程序包含一个简单的 ListView,其中包含 10 个
有人可以举一个简单的例子,其中 state monad 比直接传递 state 更好吗? bar1 (Foo x) = Foo (x + 1) 对比 bar2 :: State Foo Foo bar
我想写类似 $state.go("/spheres/{{$stateParams.sphereId}}/mono/view"); 的内容使用外部 url 而不是状态,但这不起作用:( 现在我明白为什么
我正在使用“angular-ui-tree”:“^2.22.5” 点击执行某事菜单项时出错.. TypeError: this.$state is undefined 如何将对 $state 的引用传
我在elasticsearch中有文本字段,我想在kibana上可视化词云... 第一步,我们需要标记它们,我使用了“标准标记器” ... 使用这种形式的词云可视化结果如下图所示: 但是我需要的是专有
我正在尝试以编程方式在状态之间移动(使用 ui.router),而用户无需单击任何内容。文档位于 http://angular-ui.github.io/ui-router/site/#/api/ui
我想编写像“(event, state) -> state”这样的折叠函数。如果Java中没有任何模式匹配且不可变,我该如何编写它? 最佳答案 我认为您正在寻找 Java 中的函数式编程。 此版本中引
这个问题已经有答案了: What does an exclamation mark before a variable mean in JavaScript (4 个回答) 已关闭 8 年前。 您好,
https://plnkr.co/edit/bOZW1a9u62W1QA6cYjYj?p=preview 预期 登录后,所有 $states 都会初始化,然后单击 Ticker 按钮后,唯一应重新初始
试图决定(针对我的应用程序)在 onPause() 中保存什么以及要保存在 onSaveInstanceState() 中的内容,我梳理了整个 SO 以获得提示和明确的指导方针。 如果我没理解错的话,
在 Javascript 中,当我单击滚动条(页面中出现的任何滚动条)并将鼠标悬停在图像上时,图像再次开始拖动。 图像只能在鼠标按钮按下状态下拖动。 所以我试图通过了解鼠标按钮状态(mousedown
我见过 Maybe和 Either在代码中使用仿函数(和应用)是有道理的,但我很难想出一个 State 的例子。仿函数和应用。也许它们不是很有用,只是因为 State 才存在。 monad 需要一个仿
我非常努力地想围绕 State Monad,但我不明白以下内容: 鉴于 return 的实现和 (>>=) ,当你说 State $ \s ->.... ,在哪里s来自?我的意思是,当你开始表演时 >
我是一名优秀的程序员,十分优秀!