- Index
- » Users
- » mariomar
- » Profile
Posts
Posts
Hello
Right now I'm starting with the programming in modelica, but I have some issues defining parameters, because what I want to do is to first giv some parameters to a formula and then with the result of that equatin define a new parameter. the problem is shown here:
class Resistor_cond
parameter Real num = 2;
parameter Real L = 1.5;
parameter Real W = 0.008;
parameter Real H = 0.1;
parameter Real k_bar = 385;
parameter Real nodes = 15;
Real R,L_1(start = 1);
equation
if num == 0 then
L / (4 * (nodes - 1)) = L_1;
L_1 / (H * W * k_bar) = R;
G=1/R;
elseif num == 1 then
L_1 = (3 * L) / (4 * (nodes - 1));
R = L_1 / (H * W * k_bar);
G=1/R;
elseif num == 2 then
L_1 = L / (nodes - 1);
R = L_1 / (H * W * k_bar);
G=1/R;
end if;
parameter Real G(start = 0, unit = "K/W")=1/R;
end Resistor_cond;
I want to convert the variable G into a parameter in order to put it as a parameter for a thermal resistance.
Thank you very much un advance
- Index
- » Users
- » mariomar
- » Profile