yoga
yoga

Reputation: 33

Inversing the modelica simulation model: steady state model

I want to know if a model can be inversed in modelica. (here inverse means: if in causal statement y= x +a; x and a are input and y is output; but if I want to find 'x' as output and 'y' and 'a' as input, the model is called reversed/inversed model) For example, if I have compressor with input air port and output air port, and port has variables associated with it are pressure(P), temperature(T) and mass flow rate(mdot). I have simple steady state model containing three equations as follow:

  1. OutPort.mdot = InPort.mdot
  2. OutPort.P = rc * InPort.P
  3. OutPort.T = InPort.T * (1 + rc[ (gamma-1)/gamma) - 1][/sup] / eta);

Here, rc, gamma and eta are compression ratio, ratio of specific heat capacitites and efficiency of compressor respectively.

I want to know, if I know values of : gamma, eta, OutPort.mdot, OutPort.P and OutPort.T and InPort.P and InPort.T, can I find the value of rc.

Can I find values of rc and how should be the model of compressor with above equation in Modelica. As far as I know, there are some variables designated as parameters which can not be changed during simulation. How the modelica model should be with above equations

Thanks

Upvotes: 2

Views: 292

Answers (2)

Hans Olsson
Hans Olsson

Reputation: 12517

In addition if you only want to compute the parameter rc during steady-state initialization i.e. that nothing changes with time that is also possible:

 ...
 parameter Real rc(fixed=false);
initial equation
 Inport.mdot=12; // Or something else indirectly determining rc.

The fixed=false means that rc is indirectly determined from the initialization. However, if the model is not completely stationary it will only find the correct rc during the initialization and then use that afterwards.

Upvotes: 2

Christoph
Christoph

Reputation: 5612

Yes, this should not be a problem as long as you make sure that rc is not a parameter, but a normal variable, and you supply the appropriate number of known quantities to achieve a balanced system (roughly, number of unknowns matches number of equations). E.g. in your case if you know/supply OutPort.P and InPort.P, rc is already determined from eq 2. Then, in the third equation, there are no unknowns left, so either the temperature values are consistent with the equation or you (preferably) leave one temperature value undetermined.

Upvotes: 2

Related Questions