- Index
- » Programming
- » Modelica Language
- » Using functions in decalaration of...
Page Start Prev 1 Next End
Using functions in decalaration of constants...
Using functions in decalaration of constants...
Apr-25-10 22:06:45
Hello!
From OMShell (1.5 RC3):
Code:
>> class defect
constant Real i[2,2] = transpose({{1.1,2.2},{3.3,4.4}});
Real r;
equation
r = i[2,2];
end defect;
class working
constant Real i[2,2] = {{1.1,2.2},{3.3,4.4}};
Real r;
equation
r = i[2,2];
end working;
{defect,working}
>> simulate(working)
record SimulationResult
resultFile = "working_res.plt"
end SimulationResult;
>> simulate(defect)
record SimulationResult
resultFile = "Simulation failed.
Error: Error building simulator. Buildlog: g++ -I"C:\OpenModelica1.5.0\/include" -msse2 -mfpmath=sse -I. -o defect.exe defect.cpp -lsim -L"C:\OpenModelica1.5.0\/lib" -lc_runtime -lf2c -lsendData -lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32
defect.cpp: In function `int functionDAE_output()':
defect.cpp:357: error: `$i$lB2$c2$rB' was not declared in this scope
defect.cpp: In function `int functionDAE_output2()':
defect.cpp:366: error: `$i$lB2$c2$rB' was not declared in this scope
defect.cpp: In function `int initial_residual()':
defect.cpp:515: error: `$i$lB2$c2$rB' was not declared in this scope
mingw32-make: *** [defect] Error 1
Error: Error building simulator. Buildlog: command g++ not found. Check $OPENMODELICAHOME
Error: Error building simulator. Buildlog: command "C:\OpenModelica1.5.0\/bin/Compile" not found. Check $OPENMODELICAHOME
"
end SimulationResult;
>>
Shouldn't it work?
Cheers
Hannes
Edited by: edes - Apr-26-10 00:11:21
- edes
- 38 Posts
Re: Using functions in decalaration of constants...
Apr-28-10 09:46:49
Yes, it should work. I added a bug report for this: https://openmodelica.org:8443/cb/issue/ … ation=true
- sjoelund.se
- 1700 Posts
Re: Using functions in decalaration of constants...
Apr-29-10 14:15:44
This bug has now been fixed in revision 5419 of trunk.
- perost
- 114 Posts
Page Start Prev 1 Next End
- Index
- » Programming
- » Modelica Language
- » Using functions in decalaration of...
There are 0 guests and 0 other users also viewing this topic