Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit559150b

Browse files
add tests for#3934
1 parentea660a6 commit559150b

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

‎test/fmi/fmi.jl‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ end
274274
sol.t; idxs= [sys.adder1.c, sys.adder2.c]).u rtol=1e-3
275275
end
276276

277+
@testset"multiDimArray Support"begin
278+
path_to_FMU=joinpath(FMU_DIR,"SimpleArrayModel.fmu")
279+
fmu=loadFMU(path_to_FMU)
280+
@named model= MTK.FMIComponent(Val(2); fmu, type=:ME)
281+
@test model!==nothing
282+
end
277283
functionbuild_looped_sspace(sspace1, sspace2)
278284
@variablesx(t)=1
279285
@mtkcompile sys=System([D(x)~ x, sspace1.u~ sspace2.x, sspace2.u~ sspace1.y],

‎test/fmi/fmus/SimpleArrayModel.fmu‎

2.74 MB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SimpleArrayModel.fmu is a v2 ME FMU that contains multidimensional array variables with derivatives. It is included to test SciML issue number 3934. It is generated from the Modelica model in test_mtk_2darray_bug.mo using Dymola 2022x. The translation command is
2+
3+
```julia
4+
translateModelFMU("SimpleArrayModel",false,"","2","me",true,0,fill("",0));
5+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
model SimpleArrayModel
2+
"Simple model with a 2D array variable and its derivative"
3+
4+
parameterInteger n=3"First dimension size";
5+
parameterInteger m=2"Second dimension size";
6+
7+
Real x[n,m]"Two-dimensional array variable";
8+
Real dx[n,m]"Derivative of the array variable";
9+
10+
equation
11+
// Define the derivative relationship
12+
der(x)= dx;
13+
14+
// Simple example dynamics for the derivative
15+
for i in1:nloop
16+
for j in1:mloop
17+
dx[i,j]=-x[i,j]+sin(time);
18+
end for;
19+
end for;
20+
21+
initial equation
22+
// Initial conditions
23+
x=zeros(n,m);
24+
25+
end SimpleArrayModel;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp