- Index
- » Users
- » jkocherry
- » Profile
Posts
Posts
Hi,
We are trying to find the exponential of a matrix and we are not able to find the solution to the errors we are getting. The following is the code we tried
model test_exp
Real A[3,3];
Real B[3,3];
equation
A=[1,2,3;4,5,6;7,8,9];
B=Modelica.Math.Matrices.exp(A);
end test_exp;
Please help on this
John
We are trying to use OpenModelica to solve MILP. Is this possible? If so, what is the way to specify the model with the variables that needs to get optimized?
Hi
We are trying to decrease the time taken for simulation by increasing the step size, but we are not able to get any change in the simulation time. We tried playing around with other various parameters of the simulate command, but it is not helping.
We need to reduce the time taken in order to use it for optimization. Is there any other way to speed up the simulation??
Thank you
John
Adrian, We tried
dumpXMLDAE(Final_code)
and we were getting the following error
{"Xml dump error.",""}
but then we tried the
exportDAEtoMatlab(Final_code)
and it worked, but we are not able to get the ODE format...........in the documentation they have not mentioned the parameters for obtaining that. We are able to do DAE to DAE. We need to extract the intermediate ODE/state space before it is fed to the solver
Thank you
John
Thanks a lot, Martin. We will try this.
Hi
We are working on an optimization problem and we need to get the ODE form of the equations to be used in the optimization package. I believe that OMC converts the DAE from to ODE for passing it to the inbuilt solver.
Is there any way we can get the ODE form which the OMC passes to its inbuilt solver, 'dassl'? I have read an article which says Dymola can do it. So was wondering if that option is there for OMC
Thank you
John
Hi
We need to call OpenModelica externally to obtain the results for an optimization problem. We are using a optimization package in C++ and we need to get the inputs for each iteration from OpenModelica simulation results.
So is there any way to call openModelica externally from a C code???
Thanks
John
Hi,
I am trying to read a value usign external function and assign it to a variable to be used in a derivative equation. I am getting the following error
{"",""}
"Error: Derivative of expression Functions.Psat_T(T_l) is non-existent
Here is a part of the code that is causing the error
Q_total = m_l * C * T_l + m_v * (C * T_l + lat_heat) + m_t * C_m * T_m - P_v * V;
P_v = Functions.Psat_T(T_l);
der(Q_total) = Q_in + W_in * h_w - W_out * (C * T_l + lat_heat);
I am trying to get values for P_v from the function so the equations can be solved.
Please let me know if there is any option to read the values from functions and assign it to the variable to be used in the equation,
Thanks and Regards
John
Hi
I am trying to give some initial values to the variables through initial equation section. But the intial values are not being set to the variables and the intial equations are getting bypassed. This is the code which I have developed
model sam
annotation(Diagram(coordinateSystem(extent = {{ -100, -100},{100,100}})));
parameter Real W_inic = 17.5;
parameter Real T_in = 60;
parameter Real rho_l = 983.2;
parameter Real lat_heat = 2260;
parameter Real C = 4.187;
parameter Real V = 10;
parameter Real P_out = 2;
parameter Real a = 9.2807;
parameter Real b = 2788.51;
parameter Real c = 220.79;
parameter Real ti = 500;
parameter Real cg = 0.005;
parameter Real P_vic = 4.7;
parameter Real T_zero = 273.16;
parameter Real xvz = 0.7;
parameter Real xva = 0.3;
parameter Real xvw = 0.5;
parameter Real mwt = 78;
parameter Real m_lic = (rho_l * V) / 2;
parameter Real kv = W_inic / (xvz * sqrt(P_vic * (P_vic - P_out)));
parameter Real Tl_temp = b / (a - log(P_vic)) - c;
parameter Real q = W_inic * (C * (Tl_temp - T_in) + lat_heat);
parameter Real r = 8.314 / mwt;
parameter Real Ts = 0.01;
Real xv;
Real m_total(fixed = false);
Real W_in,W_out;
Real m_l(fixed = false);
Real P_v(fixed = true);
Real rho_v;
Real V_v(fixed = true, start = 0);
Real Q_total(fixed = false);
Real m_v(fixed = false);
Real T_l(fixed = false);
equation
xv = 0;
der(m_total) = W_in - W_out;
der(Q_total) = q + W_in * C * T_in - W_out * (C * T_l + lat_heat);
m_l = m_total - m_v;
Q_total = m_l * C * T_l + m_v * (C * T_l + lat_heat);
W_in = 0;
W_out = kv * xv * sqrt(abs(P_v * (P_v - P_out))) * sign(P_v - P_out);
P_v = exp(a - b / (c + T_l));
0 = P_v - rho_v * r * (T_l + T_zero);
rho_v = m_v / V_v;
V_v = V - m_l / rho_l;
initial equation
P_v = P_vic;
T_l = 60;
V_v = 0;
m_l = (rho_l * V) / 2;
m_v = 0;
Q_total = m_l * C * T_l + m_v * (C * T_l + lat_heat);
W_out = 0;
rho_v = (P_v * V_v) / (r * (T_l + T_zero));
end sam;
But the values are being simulated as if the initial equations were not present. For example, the value of V_v starts at 5 instead of 0, P_v starts around 0.5 instead of 4.7
Any help/suggestion will be very helpful
Thank you
John
Hi,
I need to perform implicit integration as we are trying to migrate from ACSL to OpenModelica. Will it be possible to perform this?
Thanks
John
So the support for the function derivatives will be added in the new release or is it already supported in RC3?
When can we expect the new release? I am working on some projects and want to plan the deadlines based on this.
Thank you
John
Any update on the release of the latest version of OpenModelica? Will it be supporting the media library?
We are waiting..........:-)
Thank you
John
So does that mean I cant run it on this version of OpenModelica??
When is the next release scheduled?
Thank you very much for the continuous support and prompt replies
So how do I check if it is updated?
Can you suggest a way to get this one working?
Is there a release after that?
I tried running them from shell and am still getting the same errors. I have been on this for sometime
I am using the OpenModelica 1.5.0 RC3
Hi,
I am trying to find the derivative of the function. I have used the annotation that enables the derivative property of the function. As an example I tried the following code (given to me by the openModelica support)
function my_abs annotation(derivative=my_abs_der);
input Real r;
output Real out = abs(r);
end my_abs;
function my_abs_der
input Real r;
input Real der_r;
output Real out;
algorithm
out := abs(r)*der_r;
end my_abs_der;
class M
Real r = my_abs(15.0*time);
Real der_r = der(r);
end M;
I am getting the following error in SimForge
{"",""}
"Error: The language feature differentiation of function my_abs is not supported. Suggested workaround: no suggestion
Error: Derivative of expression my_abs(15.0 * time) is non-existent
Error: Model is structurally singular, error found sorting equations r = my_abs(15.0 * time); for variables "
Please give some suggestions
Thank you
John
Thank you very much...............I was referring to the examples in the book by Prof Peter Fritzson...........will check it out the way u said
Thanks again
We are modeling a Boiler in Modelica which requires extensive use of steam properties from Steam Table. Since the Media library is not yet supported in OpenModelica, we are trying to use the external functions in FORTRAN which can compute it.
As an initial step, we tried to check the external calling function for simple functions. We have the falling queries
1) where do we place the external fortran files?
2) What are the files required for calling external FORTRAN files? Is there any additional files to call other than the file that has the function?
3) We are trying to use the examples provided in the examples and not able to successfully implement it.
Thank you
John
I am getting the following error messages which is weird.
The language feature differentiation of function abs is not supported. Suggested workaround: no suggestion
Error: Derivative of expression abs(-CV.Outlet.w) is non-existent
I guess the error is for the following snippet of code
der(po) = wi - wo;
po - pi + g * L + k * wi * abs(wi) = 0;
A * der(H) + wi * B * H + E * H = A * der(po) * V - D * T + D * Tw + M * hIN;
- Index
- » Users
- » jkocherry
- » Profile