Package Modelica.​Media.​Examples.​SolveOneNonlinearEquation
Demonstrate how to solve one non-linear algebraic equation in one unknown

Information

This package demonstrates how to solve one non-linear algebraic equation in one unknown with function Modelica.Media.Common.OneNonLinearEquation.

Extends from Modelica.​Icons.​ExamplesPackage (Icon for packages containing runnable examples).

Package Contents

NameDescription
Inverse_sh_TSolve h = h_T(T), s = s_T(T) for T, if h or s is given for ideal gas NASA
Inverse_sh_TXSolve h = h_TX(TX) for T, if h is given for ideal gas NASA
Inverse_sineSolve y = A*sin(w*x) for x, given y
InverseIncompressible_sh_TInverse computation for incompressible media

Model Modelica.​Media.​Examples.​SolveOneNonlinearEquation.​Inverse_sine
Solve y = A*sin(w*x) for x, given y

Information

This models solves the following non-linear equation

   y = A*sin(w*x); -> determine x for given y

Translate model "Inverse_sine" and simulate for 0 sec. The result is printed to the output window.

Extends from Modelica.​Icons.​Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Realy_zero0.5Desired value of A*sin(w*x)
Realx_min-1.7Minimum value of x_zero
Realx_max1.7Maximum value of x_zero
RealA1 
Realw1 
f_nonlinear_DatadataInverse_sine_definition.f_nonlinear_Data(A = A, w = w) 

Model Modelica.​Media.​Examples.​SolveOneNonlinearEquation.​Inverse_sh_T
Solve h = h_T(T), s = s_T(T) for T, if h or s is given for ideal gas NASA

Information

Extends from Modelica.​Icons.​Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_min300Vary temperature linearly from T_min (time=0) up to T_max (time=1)
TemperatureT_max500Vary temperature linearly from T_min (time=0) up to T_max (time=1)
Pressurep100000Fixed pressure in model
final SpecificEnthalpyh_minMedium.specificEnthalpy(Medium.setState_pT(p, T_min))Specific enthalpy at T_min
final SpecificEnthalpyh_maxMedium.specificEnthalpy(Medium.setState_pT(p, T_max))Specific enthalpy at T_max
final SpecificEntropys_minMedium.specificEntropy(Medium.setState_pT(p, T_min))Specific entropy at T_min
final SpecificEntropys_maxMedium.specificEntropy(Medium.setState_pT(p, T_max))Specific entropy at T_max

Model Modelica.​Media.​Examples.​SolveOneNonlinearEquation.​InverseIncompressible_sh_T
Inverse computation for incompressible media

Information

Extends from Modelica.​Icons.​Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_minMedium.​T_minVary temperature linearly from T_min (time=0) up to T_max (time=1)
TemperatureT_maxMedium.​T_maxVary temperature linearly from T_min (time=0) up to T_max (time=1)
Pressurep100000Fixed pressure in model
final SpecificEnthalpyh_minMedium.h_T(Medium.T_min)Specific enthalpy at T_min
final SpecificEnthalpyh_maxMedium.h_T(Medium.T_max)Specific enthalpy at T_max
final SpecificEntropys_minMedium.specificEntropy(Medium.setState_pT(p, T_min))Specific entropy at T_min
final SpecificEntropys_maxMedium.specificEntropy(Medium.setState_pT(p, T_max))Specific entropy at T_max

Model Modelica.​Media.​Examples.​SolveOneNonlinearEquation.​Inverse_sh_TX
Solve h = h_TX(TX) for T, if h is given for ideal gas NASA

Information

Extends from Modelica.​Icons.​Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_min300Vary temperature linearly from T_min (time=0) up to T_max (time=1)
TemperatureT_max500Vary temperature linearly from T_min (time=0) up to T_max (time=1)
Pressurep100000Fixed pressure in model
final SpecificEnthalpyh_minMedium.h_TX(T_min, X)Specific enthalpy at T_min
final SpecificEnthalpyh_maxMedium.h_TX(T_max, X)Specific enthalpy at T_max
final SpecificEntropys_minMedium.specificEntropy(Medium.setState_pTX(p, T_min, Medium.reference_X))Specific entropy at T_min
final SpecificEntropys_maxMedium.specificEntropy(Medium.setState_pTX(p, T_max, Medium.reference_X))Specific entropy at T_max
MassFractionX[4]Medium.​reference_XMass fraction vector