• No results found

2. Modeling Techniques

2.4 Physics Based Model Reduction

The main purpose of dynamic models is to capture the dynamic behavior of a system. When the model is to be used for control, the dynamic accuracy of the model is important in the vicinity of the crossover frequency of the feedback loop and less important at other frequencies. When controllers with integral action are used, the closed loop gain is infinity atω = 0 and therefore the accuracy of the open loop gain atω = 0 is not important, nei-ther are the properties at frequencies that are higher than the crossover frequency. As a motivating example, an investigation of a model reduc-tion from the electrical domain will be presented as a general, but simple case of dynamic model reduction. Often the question arises whether it is possible to lump energy storage of two closely connected physical sub-models into one unit or not. The Modelica language and in particular the Dymola simulation tool allow to design model libraries where the tedious part of such model reduction procedures is handled automatically be the tool when the user chooses model combinations that call for this simpli-fication. The details of how this works in thermo-hydraulic cases will be presented in the following.

Example: An Electrical Circuit

The example consists of the simple electric circuit in Figure 2.7. The source voltage is the input to the system, the voltage over the capaci-tor C2 is the output. The system can be transformed into a linear state space system with the voltages of the two capacitances as states. The

4Note that it is well possible for a model to pass an external validation with respect to a real system and to fail the internal validation.

2.4 Physics Based Model Reduction

Ground R=1

R2

R=1

R1

C1 C2

VS1 C=2 C=1 Vout

Vin

Figure 2.7 Simple electrical circuit with two capacitors.

linear system becomes:

˙x= Ax + Bu

y= Cx x= vC1

vC2

!

A= −CR11C+R2R21 C11R2

C21R2C21R2

!

, B= C11R1 0

!

, C= (0 1)

with the transfer function vout

vin = 1

C1C2R1R2s2+ s(R1(C1+ C2) + C2R2) + 1.

The system stores energy in the two capacitors. The question of inter-est is now: under which circumstances is it possible to describe the system with one capacitor of the capacitance C1+C2instead of two? A simple way to do the model reduction is to neglect the resistance and set R2= 0. The transfer function simplifies to

vout

vin = 1

sR1(C1+ C2) + 1.

This has the effect to lump the capacitors into one with the sum of the orig-inal capacitances. Observe that a second order linear ODE system where we simply set R2 = 0 is singular. In the DAE-framework this is easy to treat. From R2= 0 we have that vC1= vC2, the constraint equation, com-pare Section 2.1, of the index 2 DAE. The index reduction can be handled automatically, resulting in a reduced order ODE system. The singularity

Chapter 2. Modeling Techniques

0 200 400 600 800 1000

Resistance of R2 -12

-10 -8 -6 -4 -2 0

MagnitudeoftheEigenvalues

Eigenvalues of the System as a Function of R2

SlowEigenvalue Fast Eigenvalue Lumped Eigenvalue

Figure 2.8 Eigenvalues of dynamics matrix A for the electrical system in Fig-ure 2.7

problem of the higher order ODE formulation is avoided. This feature of the DAE formulation can also be exploited for model order reduction for a non-zero, but small R2. For a choice of parameters R1= 1000,C1= 0.002 and C2= 0.001 we look at the eigenvalues of A(Figure 2.8) and the Bode plot(Figure 2.9) of the transfer function as R2 decreases. As can be seen from Figure 2.8, one eigenvalue is around 1/3 whereas the other goes to infinity as R2 gets small. For comparison, the constant eigenvalue result-ing from a simplified circuit with R2= 0 and and a lumped capacitor with C= C1+ C2is also shown. From the look at the eigenvalues it seems to be possible to neglect the resistance R2for values of R2< 500. Observe that the eigenvalues are independent of the choice of inputs and outputs. An inspection of the bode plot in Figure 2.9 for the chosen input- and output signals reveals that the justification of the model reduction depends on the frequency content of the input signal. It is clear from the bode plot that the closed loop bandwidth is the limiting factor that determines for which values of R2it is possible to use the simplified system. It is clearly not advisable to neglect any of the energy stores C1 or C2 which are of the same order of magnitude. After this short excursion into the electrical domain, a similar situation for thermodynamic models is explored.

2.4 Physics Based Model Reduction

Frequency (rad/sec)

Phase (deg)Magnitude (dB)

−150

−100

−50 0

10−2 10−1 100 101 102 103 104

−180

−135

−90

−45 0

R2= 500 R2= 50 R2= 0.0

Figure 2.9 Bode Plots of the electrical system in Figure 2.7 for different values of R2

Heat Exchangers

The type of model reduction presented in the previous example seems natural in that case. When the example is transferred to heat exchangers instead, the equivalent model reduction is not commonly used. Excep-tions are special purpose low order models like the drum boiler model by [Åström and Bell, 2000]. This model reduction refers to an interesting case from Section 4.10 of combining a solid structure with a fluid when both the boundary layer heat resistance and the metal resistance are neglected. In-stead of having separate energy balances for the wall and the fluid, these are combined into one energy store, equivalent to the lumping of the ca-pacitors in the last example. Equating the temperatures Tf luid1 = Tm(see Figure 4.6) gives the wanted result. Again, an index two DAE system is the result where Tf luid1= Tm is the constraint equation which is used to calculate the heat flow when differentiated. This means, similarly as in the electrical case, that the heat flow resistance is set to zero. Assuming for now that the fluid uses pressure p and specific enthalpy h as states

Chapter 2. Modeling Techniques

and that the thermodynamic equation of state is explicit in these states, the temperature difference can be expressed as

dT dt = VT

V p

h

dp dt + VT

Vh

p

dh

dt (2.15)

in the one phase region and as dTsat

dt = dTsat dp

dp

dt (2.16)

in the two phase region, where the temperature does not depend on the enthalpy. Usually the temperature is calculated via a function and not an equation. In current Modelica implementations, functions can not be differentiated unless a derivative function is written by the user and the annotation for function derivatives (see Section 3.4) is used to convey the derivative information to the simulator. If this is implemented in the model library, the model reduction is automatic whenever a user connects a fluid control volume and a resistance-free wall model without an ex-plicit heat transfer law between them. The validity of doing this model reduction depends on the parameters of the actual physical system: in a condenser with very high heat transfer coefficients this assumption is usu-ally valid for the condensing flow. The same holds for most walls in contact with boiling or condensing two phase flow. Focusing on the energy stor-age point of view this model reduction is equivalent to lumping two fluid control volumes into one volume. The lumping of small control volumes into a larger one is done routinely without questioning that simplification technique. With regard to the energy storage the example of lumping the solid and fluid energies is identical to the case of the capacitors.

Another case where this model reduction is particularly useful is mod-eling of thermal stresses during load changes in power plants. In that case the situation is slightly different: The metal mass has to be discretized in radial direction in order to model thermal stress. The innermost section of the metal in contact with the fluid is then modeled to have the same temperature as the fluid. The speed of possible load changes is limited by the thermal stress in the thick-walled metal mass. The thermal stress is proportional to the temperature difference between the innermost and outermost metal fiber.

In the case of the drum boiler derived in[Åström and Bell, 2000] the model reduction is not made by the simulation tool but by the model developer: this is an error-prone procedure which should be avoided.

While the automatic model reduction presented here is possible and desirable, it does not fully fit together with other aspects of library organi-zation and is not the most efficient solution possible. In current Modelica

2.5 Modeling Tools