- 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/
我系统上的docker info命令输出如下: # docker info Containers: 0 Images: 0 Storage Driver: devicemapper ..... D
我如何捕获用户按下 ctrl + space + space? 我用这段代码成功测试了ctrl + space: RegisterHotKey(0, 1, MOD_CONTROL, VK_SPACE)
我有一个 Matlab 图,我想在论文中使用。此图包含多个 cdfplots。现在的问题是我不能使用标记,因为在情节中变得非常密集。如果我想让样本稀疏,我必须从 cdfplot 中删除一些样本,这将导
我正在尝试获取我将用于备份的服务器上所有数据库的列表。以下是我尝试打印数据库列表但出现错误的代码片段。如何解决?添加双方括号并不能解决问题。 我已经研究了一些类似的问题,但我无法弄清楚。 grep:字
我了解 new gen/old gen/perm gen 之间的区别,但我不知道“To Space”和“From Space”是什么。我看到我的“From Space”使用率达到 99.8%,而“To
我当前有一个返回时看起来像这样的字符串: //This is the url string // the-great-debate---toilet-paper-over-or-under-the-r
我太亲密了。我正在尝试编写用于Notepad++的正则表达式表达式,以用空格替换破折号,而忽略已经用前置/后置空格代替的破折号。我知道我可以用“foobarfoo”搜索/替换“-”,然后搜索“-”替换
我的 ANTLR 代码如下: LPARENTHESIS : ('('); RPARENTHESIS : (')'); fragment CHARACTER : ('a'..'z'|'0'..'9'|)
在过去的 6 个小时里,我一直在尝试在我的 webgl 应用程序中实现点击,但我找不到任何关于这个主题的足够清晰的内容。 到目前为止,我想出的是伪代码: screenSpace = mousePosi
如何使用正则表达式来测试空格或制表符,但不测试换行符? 我尝试了 \s,但我发现它也测试换行符。 我使用C# (.NET) 和 WPF ,但这应该不重要。 最佳答案 使用字符类:[\t] 关于rege
我想解析以下内容: name:name 名称以字母开头和结尾,并且可以包含字母和空格的任意组合。它们也可以是空白的。我的规则是: identifier = alnum (space* alnum)*;
有什么办法可以让 Eden 空间按比例大于 Tenured 空间吗?有 NewRatio 但它以相反的方式工作(Tenured 比 Eden 大几倍)。 我知道有 -XX:NewSize= 和 -XX
我正在编写一个程序,让人们输入他们的信息(姓名,年龄......)。对于姓名输入,我不希望他们留空,只允许字母和空格,但不能以空格开头。合适的正则表达式是什么?我尝试使用: ^[a-zA-Z\\s]*
好的,我正在制作一个程序,它也可以制作垂直线、水平线和对角线!我对我的一个没有任何意义的输出感到困惑。 所以我的伪代码是这样的: //enter a char //enter a number
当我使用 scp 从服务器复制文件时, 我错误地使用了命令 scp xxx@xxxx:xx.zip . 当我完成后,我发现该文件的名称是 .我无法解压 这是目录列表。 http://pfil
我需要一个 bat 文件来获取 Windows 系统中 C:\驱动器的总空间和可用空间(以 GB(千兆字节)为单位),并创建一个包含详细信息的文本文件。 注意:我不想使用任何外部实用程序。 最佳答案
作为预处理我的数据的一部分。我希望能够替换空格后跟数字,同时保留空格后跟一个字符。例如: Input String: '8.1.7 Sep 2000 Dec 2004 Dec 2006 Indefin
我正在编写一个 XPath 表达式,但我修复了一个奇怪的错误,但是以下两个 XPath 表达式之间有什么区别? "//td[starts-with(normalize-space()),'Posted
在 C 中,当读取文本文件时,是否有可能接受一个未知大小的整数值(假设它适合 int),因为它在数字之前和数字之后都有一个空格。例如。 363 865我想分别存储 363 和 865,因为它们有自己的
在 sys/ptrace.h 中,我看到类似这样的内容: @define PT_READ_I 1 /* read world in child's I space*/ @define PT_READ
我是一名优秀的程序员,十分优秀!