-
Notifications
You must be signed in to change notification settings - Fork 49
/
table.lua
42 lines (36 loc) · 1.06 KB
/
table.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-- status: correct
-- teardown_command: rm -rf table_lua/
-- linux: yes
-- ucrt64: yes
-- win: yes
-- mac: yes
oms_setCommandLineOption("--suppressPath=true")
oms_setTempDirectory("./table_lua/")
oms_setWorkingDirectory("./table_lua/")
systems = {oms_system_wc, oms_system_sc}
for _,system in ipairs(systems) do
oms_newModel("table")
oms_addSystem("table.root", system)
-- instantiate table
oms_addSubModel("table.root.A", "../../resources/table.csv")
oms_instantiate("table")
oms_initialize("table")
oms_simulate("table")
print("A.y: " .. oms_getReal("table.root.A.y"))
oms_terminate("table")
oms_delete("table")
if 1 == oms_compareSimulationResults("../../resources/table.csv", "table_res.mat", "table.root.A.y", 1e-4, 1e-4) then
print("system is equal")
else
print("system is not equal")
end
end
-- Result:
-- info: Result file: table_res.mat (bufferSize=10)
-- A.y: 0.0
-- system is equal
-- info: model doesn't contain any continuous state
-- info: Result file: table_res.mat (bufferSize=10)
-- A.y: 0.0
-- system is equal
-- endResult