- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » how to get constants from other models?
Page Start Prev 1 Next End
how to get constants from other models?
how to get constants from other models?
Aug-01-17 11:01:01
Hi,
I'm trying to access some constants from a package that i created. While doing so I get the following error "Real Alias variable c.Tc not found".
.I have constants in 'Database' package, I want to edit 'data' model so that i can take only required things from 'Database' and use them in 'testdata' model. Below is the code
Code:
class paramtertest
package Database
model General_Properties
constant Real Tc;
end General_Properties;
model Hydrogen
extends General_Properties(Tc = 30);
end Hydrogen;
model Helium
extends General_Properties(Tc = 40);
end Helium;
end Database;
model data
constant Database.Hydrogen a ;
end data;
model testdata
Real b;
constant Database.General_Properties c = data.a;
equation
b= c.Tc;
end testdata;
end paramtertest;
how to assign Tc of Hydrogen to variable b?
- swaroop.katta
- 23 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » how to get constants from other models?
There are 0 guests and 0 other users also viewing this topic