- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Reading values from external file and...
Reading values from external file and use it as in a derivative
Reading values from external file and use it as in a derivative
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
Re: Reading values from external file and use it as in a derivative
It might be possible to fix this using derivative annotations, meaning you make another function that is the
derivative of Functions.Psat_T and add an derivative annotation to Functions.Psat_T pointing to the new
function.
See Section: 12.7 Declaring Derivatives of Functions
http://www.modelica.org/documents/ModelicaSpec32.pdf
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Reading values from external file and...