Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling,...

74
Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann Institut für Mathematik Technische Universität Berlin Research Center MATHEON Mathematics for key technologies

Transcript of Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling,...

Page 1: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Port-Hamiltonian modeling,simulation, and optimization for

coupled multi-physics andmulti-scale systems

Volker MehrmannInstitut für Mathematik

Technische Universität Berlin

Research Center MATHEONMathematics for key technologies

Page 2: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outline

1 Motivation2 Application: Gas transport networks3 Energy based modeling4 Gas transport pHDAE5 Power networks6 PHDAE formulation of generalized Kuramoto7 Other physical domains8 Conclusion

2 / 71

Page 3: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

German energy transformationThe German government has decided to move out of nuclearenergy and also to reduce CO2 emissions drastically.This leads to large scientific and technological challenges.. The security of energy supply has to be guaranteed.. Different energy sectors have to be coupled, e.g. green and

fossil energy. Power-to-gas, gas-to-power, etc.. Different components of energy networks have very different

modeling accuracy.. Different energy sectors live on very different (time) scales.. Renewables require to deal with increased randomness and

decentralization. Energy customers become ’prosumers’.. Dynamical rather than stationary approaches are needed.How can we deal with these challenges in modeling, simulation,optimization and control? (MSO)

3 / 71

Page 4: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Coupling of gas and power networks

Figure: Major lines of power and gas grid in Europe.

4 / 71

Page 5: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

The MSO paradigm

Modeling, simulation, and optimization (MSO) of realmultiphysics system.. Create a model hierarchy of different modeling accuracy for

every component.. Choose representations of the models so that the coupling of

different physical domains works across many scales. Define the goal (simulation, optimization, stabilization, . . .). Analyze all errors (model, data, discretization, solution of

equations, even roundoff in finite arithmetic.). Adaptively choose model in the hierarchy, space-time

discretization accuracy, and solver accuracy depending ongoal and the required tolerance.

. Use a network approach via port-Hamiltonian systems.

5 / 71

Page 6: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outline

1 Motivation2 Application: Gas transport networks3 Energy based modeling4 Gas transport pHDAE5 Power networks6 PHDAE formulation of generalized Kuramoto7 Other physical domains8 Conclusion

6 / 71

Page 7: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

SFBTRR 154

Collaborative Research Center TransregioModelling, simulation and optimization of Gas networks

. HU Berlin

. TU Berlin

. Univ. Duisburg-Essen

. FA University Erlangen-Nürnberg

. TU DarmstadtProject: Controlled coupling of hybrid network systems

7 / 71

Page 8: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Components of gas flow modelSystem of partial differential equations with algebraic constraints. 1D Euler equations (with temperature) to describe flow in

pipes.. Network model, flow balance equations (Kirchoff’s laws).. Network elements: pipes, valves, compressors (controllers,

coolers, heaters). (Switched system). Surrogate and reduced order models.

. Erratic demand and nomination of transport capacity.

. Using gas network as storage for hydrogen, methaneproduced from unused renewable energy.

Goal: Gas flow simulation, control and optimization using amodel hierarchy.

8 / 71

Page 9: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Challenge

. Gas networks are very large!

9 / 71

Page 10: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Challenge

. Gas networks are very large!

9 / 71

Page 11: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Challenge

. Gas networks are very large!

9 / 71

Page 12: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Challenge

. Gas networks are very large!

9 / 71

Page 13: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Gas flow: Euler equations

∂ρ

∂t+

∂x(ρv) = 0,

∂t(ρv) +

∂x(p + ρv2) = − λ

2Dρv |v | − gρh′,

∂t

(ρ(

12

v2 + e))+

∂x

(ρv(

12

v2 + e) + pv)

= −kw

D(T − Tw ) ,

together with equations for a real gas, p = RρTz(p,T ).. density ρ, kw heat transfer coefficient,. temperature T , wall temperature Tw ,. velocity v , g gravitational force,. pressure p, λ friction coefficient,. h′ slope of pipe, D diameter of pipe,. e internal energy, R gas constant of real gas.

10 / 71

Page 14: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Full hierarchy

Full model hierarchy for gas flow.P. Domschke, B. Hiller, J. Lang, C. Tischendorf (2017).

11 / 71

Page 15: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Model simplification I

Constant temperature→ the isothermal Euler equations.Model M1:

∂ρ

∂t+

∂x(ρv) = 0,

∂t(ρv) +

∂x(p + ρv2) = − λ

2Dρv |v | − gρh′,

together with the state equation for real gases

p = ρ(1 + αp)RT .

12 / 71

Page 16: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Simplification II

If v is small, neglect the term ∂∂x

(ρv2)→ semilinear model

Model M2:

∂ρ

∂t+

∂x(ρv) = 0,

∂t(ρv) +

∂p∂x

= − λ

2Dρv |v | − gρh′,

13 / 71

Page 17: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Space-time-DiscretizationDiscretization using an implicit box scheme Wendroff 1960.For the scalar balance law

ut + f (u)x = g(u),

with initial conditions u(x ,0) = u0(x), the box scheme is

un+1j−1 + un+1

j

2=

unj−1 + un

j

2− ∆t

∆x

(f n+1j − f n+1

j−1

)+ ∆t

gn+1j−1 + gn+1

j

2.

At every step, (under certain conditions) a unique solution exists,Kolb, Lang, and Bales 2010.Convergence of order 2 in space and order 1 in time.Space-Time-Adaptivity via step-size control and a posteriorierror analysis.

14 / 71

Page 18: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Simplification III

When a stationary model is assumed, i.e., ∂∂t = 0, and h′ = 0,

two ODEs are obtained, which can be solved analytically.Model M3:

ρv = const.,

p(x) =

√p2

in −λc2x

Dρv |ρv |.

This algebraic model (Weymouth equation) is used in planningand often further approximated by piecewise linear model.

Further simplifications: Reduced order models (later).

15 / 71

Page 19: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Three level model hierarchy

Isothermal EulerEquations (M1)

SemilinearModel (M2)

AlgebraicModel (M3)

∂∂x

(ρv2)

= 0

∂∂t = 0,h′ = 0

Figure: Model Hierarchy

Which model for which simulation/optimization goal?Port-Hamiltonian formulation?Can we use the hierarchy to control the errors?

16 / 71

Page 20: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Sensitivities/error estimates

Determine sensitivities in parameters, error estimates,distributions of uncertainties, when model is simplified,discretized, reduced, or subjected to data uncertainty.

. Sensitivity/error analysis has to be done with thesimulation/optimization goal in mind.

. Carry out this analysis for the whole hierarchy, using analyticformulas or adjoint equations.

. Determine a posteriori error estimates ηx , ηt , ηm in space, time,and model (or data uncertainty) to control computational cost.

. Ern A., Vohralík, M. Polynomial-degree-robust a posteriori estimates in a unified setting for conforming, nonconforming,discontinuous Galerkin, and mixed discretizations. SIAM J. Numer. Anal. 53, 1058–1081, 2015.

. J.J. Stolwijk and V. M. Error analysis and model adaptivity for flows in gas networks. ANAL. STIINTIFICE ALE UNIV. OVIDIUSCONSTANTA. SERIA MATEMATICA, 2018.

17 / 71

Page 21: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Computational Cost OptimizationMSO Goal: Simulation time minimizationTo optimize computational cost, choose cost function

F (m,nx ,nt) = Cm · nαmx · n

βmt

Tune (learn) constants Cm, αm, and βm from simulations.

18 / 71

Page 22: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Minimization of CPU timeSearch for a space-time-model error control which satisfies∑

j∈Jp(ηm,j + ηx ,j + ηt ,j)

|Jp|≤ tol

. Included in the flow code ANACONDA (TU Darmstadt).

. Test case: Gas network of |Jp| = 12 pipelines.

. Achieved computing time reductions of 80%.. P. Domschke, A. Dua, J.J. Stolwijk, J. Lang, and V. M., Adaptive Refinement Strategies for the Simulation of Gas Flow in

Networks using a Model Hierarchy, Electronic Transactions Numerical Analysis, 2018.

19 / 71

Page 23: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Minimization of compressor costMinimize compressor costs subject tovariable bounds, mass balance, compressor models.Classical switched nonlinear optimal control problem

Optimization code steers the accuracy, the discretization error,and chooses the model according to error estimates to obtain ineach step a feasible solution.

TheoremSuppose that the error estimator leads to a local error reductionfor every arc in the pipe network and that every NLP is solved tolocal optimality. Then, the NLP solver terminates after a finitenumber of steps with an ε-feasible solution with respect to areference configuration.

20 / 71

Page 24: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Example: Compressor cost optimization

Discretization, model, total error (y -axis) over course ofoptimization (x-axis). Left: GasLib-40, right: GasLib-135.. V. M., M. Schmidt, and J. Stolwijk, Model and Discretization Error Adaptivity within Stationary Gas Transport Optimization,

http://arxiv.org/abs/1712.02745, 2017.

21 / 71

Page 25: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Intermediate summary, challenges

. Model hierarchy for gas networks.

. Space-time-model adaptivity.

Challenges

. Can we reduce the models further by model reduction?

. Can we use the same approach for power networks andcoupled power/gas networks?

. How about the different time scales?

. What is the right framework for modeling?

22 / 71

Page 26: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outline

1 Motivation2 Application: Gas transport networks3 Energy based modeling4 Gas transport pHDAE5 Power networks6 PHDAE formulation of generalized Kuramoto7 Other physical domains8 Conclusion

23 / 71

Page 27: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Energy based modeling

. Choose representations of models so that coupling ofdifferent physical domains works across many scales.

. Use energy as common quantity of different physical systems.

. We want a representation that is good for model coupling, thatis good for discretization, and that is close to physics.

. A system theoretic way to deal with such energy basedmodeling is that of port-Hamiltonian systems.

. P. C. Breedveld. Modeling and Simulation of Dynamic Systems using Bond Graphs, pages 128–173. EOLSS Publishers Co.Ltd./UNESCO, Oxford, UK, 2008.

. B. Jacob and H. Zwart. Linear port-Hamiltonian systems on infinite-dimensional spaces. Operator Theory: Advances andApplications, 223. Birkhäuser/Springer Basel CH, 2012.

. A. J. van der Schaft, D. Jeltsema, Port-Hamiltonian systems: network modeling and control of nonlinear physical systems. InAdvanced Dynamics and Control of Structures and Machines, CISM Courses and Lectures, Vol. 444. Springer Verlag, NewYork, N.Y., 2004.

. A. J. van der Schaft, Port-Hamiltonian differential-algebraic systems. In Surveys in Differential-Algebraic Equations I,173-226. Springer-Verlag, 2013. Port-Hamiltonian systems theory: An introductory overview.

. . . .

24 / 71

Page 28: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Port-Hamiltonian systemsClassical port-Hamiltonian (pH) ODE/PDE systems

x = (J(x , t)− R(x , t))∇xH(x) + (B(x , t)− P(x , t))u(t),

y(t) = (B(x , t) + P(x , t))T∇xH(x) + (S(x , t) + N(x , t))u(t),

. H(x) is the Hamiltonian: it describes the distribution ofinternal energy among the energy storage elements;

. J = −JT describes the energy flux among energy storageelements within the system;

. R = RT ≥ 0 describes energy dissipation/loss in the system;

. B ± P: ports where energy enters and exits the system;

. S + N, S = ST , N = −NT , direct feed-through input to output.

. In the infinite dimensional case J,R,B,P,S,N are operatorsthat map into appropriate function spaces.

25 / 71

Page 29: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Properties. Port-Hamiltonian systems generalize Hamiltonian systems.. Conservation of energy replaced by dissipation inequality

H(x(t1))−H(x(t0)) ≤∫ t1

t0y(t)T u(t) dt ,

. Port-Hamiltonian systems are closed under power-conservinginterconnection. Models can be coupled in modularized way.

. Minimal constant coefficient pH systems are stable andpassive.

. Port-Hamiltonian structure allows to preserve physicalproperties in Galerkin projection, model reduction.

. Physical properties encoded in algebraic structure ofcoefficients and in geometric structure associated with flow.

. Systems are easily extendable to incorporate multiphysicscomponents: chemical reaction, thermodynamics,electrodynamics, mechanics, etc. Open/closed systems.

26 / 71

Page 30: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Port-Hamiltonian DAEsDefinition (C. Beattie, V. M., H. Xu, H. Zwart 2017)A linear variable coefficient (P)DAE of the form

Ex = [(J − R)Q − EK ] x + (B − P)u,y = (B + P)T Qx + (S + N)u,

with E ,A,Q,R = RT ,K ∈ C0(I,Rn,n), B,P ∈ C0(I,Rn,m),S + N ∈ C0(I,Rm,m) is called port-Hamiltonian DAE (pHDAE) if :

i) L := QT E ddt −QT JQ −QT EK is skew-adjoint.

ii) QT E = ET Q is bounded from below by a constant symmetric H0.

iii) W :=

[QT RQ QT PPT Q S

]≥ 0, t ∈ I.

Hamiltonian: H(x) := 12xT QT Ex : C1(I,Rn)→ R.

27 / 71

Page 31: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Properties. Nonlinear version available (not much analysis though).. Dissipation inequality still holds.. PH DAE systems closed under power-conserving

interconnection. Models can be coupled in modularized way.. PH DAE structure invariant under time varying basis changes.. Canonical forms in constant and variable coefficient case.. Port-Hamiltonian structure preserved under constraint

preserving Galerkin projection, model reduction.. Representation is very robust to structured perturbations.. C. Beattie, V. M., H. Xu, and H. Zwart, Linear port-Hamiltonian descriptor systems. https://arxiv.org/pdf/1705.09081.pdf. C. Beattie, V. Mehrmann, and P. Van Dooren, Robust port-Hamiltonian representations of passive systems.

http://arxiv.org/abs/1801.05018. N. Gillis, V. Mehrmann, and P. Sharma, Computing nearest stable matrix pairs. Numerical Linear Algebra with Applications,

2018. https://arxiv.org/pdf/1704.03184.pdf. C. Mehl, V. M., and M. Wojtylak, Linear algebra properties of dissipative Hamiltonian descriptor systems.

http://arxiv.org/abs/1801.02214. L. Scholz, Condensed Forms for linear Port-Hamiltonian Descriptor Systems. Preprint 09-2017, Institut f. Mathematik, TU

Berlin, 2017.

28 / 71

Page 32: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outline

1 Motivation2 Application: Gas transport networks3 Energy based modeling4 Gas transport pHDAE5 Power networks6 PHDAE formulation of generalized Kuramoto7 Other physical domains8 Conclusion

29 / 71

Page 33: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Gas transport model

v1 v2

v3

v4

e1

e2

e3

Figure: Graph G = (V, E) with vertices V = v1, v2, v3, v4 and edgesE = e1,e2,e3 defined by e1 = (v1, v2), e2 = (v2, v3), ande3 = (v2, v4).

30 / 71

Page 34: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Gas transport pH-PDAE. Model on every edge e ∈ E the conservation of mass and the

balance of momentum, z = (p,q).

ae∂tpe + ∂zqe = 0, e ∈ E ,be∂tqe + ∂zpe + deqe = 0, e ∈ E ,

where pe, qe denote the pressure and mass flux, respectively.

. Encode in ae(t , z),be(t , z) > 0 physical properties of fluid and pipe,in de(t , z) ≥ 0 damping due to friction, and introduce interior andexterior vertices V0 and V∂ = V \ V0.

. Model conservation of mass and momentum at v ∈ V0 by∑e∈E(v)

ne(v)qe(v) = 0

pe(v) = pf (v), e, f ∈ E(v),where E(v) = e : e = (v , ·) or e = (·, v) is the set of edgesadjacent to v and ne(v) = ∓1 (flow direction).

31 / 71

Page 35: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

PH PDAE

. Inputs: pe(v) = uv , v ∈ V∂ , e ∈ E(v)

. Output: the mass flux in and out of the network via the exteriorvertices

yv = −ne(v)qe(v), v ∈ V∂ , e ∈ E(v),

. Initial conditions: p(0) = p0, q(0) = q0 on E for pressure and massflux.

. Quadratic Hamiltonian:

H =12

∑e∈E

∫e

ae|pe|2 + be|qe|2dz.

Use this model for discretization and model reduction viaGalerkin projection.

32 / 71

Page 36: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Discontinuous Galerkin discretizationExistence of unique solution for consistent initial conditions p0,q0 and sufficiently smooth inputs (uv )v∈V∂ , in Egger/Kugler 2016.Mixed finite element space discretization leads to index twoconstant coefficient large scale pHDAE:

Ex = (J − R)x + Bu,y = BT x ,

x(0) = x0,

here Q = I, S,N,P = 0, E = ET .

E =

M1 0 00 M2 00 0 0

, J =

0 −G 0GT 0 NT

0 −N 0

,R =

0 0 00 D 00 0 0

,B =

0B20

.The discretized Hamiltonian is given by

H(x) = 12

xT Ex =12(xT

1 M1x1 + xT2 M2x2).

33 / 71

Page 37: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Model reduction for pH systemsEvery Galerkin projection MOR method preserves the structureof pH systems. Replace

x = (J − R)∇xH(x) + Bu, y = BT∇xH(x)

by reduced system

xr = (Jr − Rr )∇xr Hr (xr ) + Br u, yr = BT∇xr Hr (xr )

with x ≈ Vr xr , ∇xH(x) ≈Wr∇xr Hr (xr ), Jr = W Tr JWr ,

Rr = W Tr RWr W T

r Vr = Ir , Br = W Tr B.

If Vr and Wr are appropriate orthornormal bases, then theresulting system is again pH and all properties are preserved.. R.V. Polyuga, A.J. van der Schaft. Structure preserving model reduction of port-Hamiltonian systems by moment matching at

infinity. Automatica, vol. 46, pp. 665-672, 2010.

. C. Beattie and S. Gugercin. Structure-preserving model reduction for nonlinear port-Hamiltonian systems. CDC-ECC, 2011.

Extension to pHDAEs in an obvious way.34 / 71

Page 38: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Galerkin MOR for gas flow

. Model reduction (projection spaces) via moment matching.

. Proof of Well-posedness, conservation of mass, dissipationinequality, and exponentially stability of steady states.

. Specially structured (modified) Krylov method to satisfyalgebraic compatibility conditions.

. CS decomposition to guarantee Lagrangian structure inapproximation.

. No reduction of constraints.

. Efficient construction of projection spaces Vr ,Wr .

. Proof of a posteriori error bounds.

. H. Egger, T. Kugler, B. Liljegren-Sailer, N. Marheineke, and V. M., On structure preserving model reduction for damped wavepropagation in transport networks, SIAM Journal Scientific Computing, to appear 2018. http://arxiv.org/abs/1704.03206

35 / 71

Page 39: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Splitting and CS decomposition

. Splitting of the projection matrix W = [W1; W2; W3]corresponding to the solution components x = [x1; x2; x3].

. Even if columns of W are orthogonal, this is no longer true forthe columns of Wi .

. Re-orthogonalization is required.

. Splitting very sensitive to numerical errors.

. Use cosine-sine (CS) decomposition,[W1

W2

]=

[U1 00 U2

] [CS

]X>,

with U1, U2, and X orthogonal, and C,S diagonal with entriesC2

ii + S2ii = 1.

36 / 71

Page 40: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Pressure correction

With and without pressure correction via CS decomposition ofthe Galerkin-projection space.

37 / 71

Page 41: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Small network

38 / 71

Page 42: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Paramametric MOR

Results for discretized model (blue) and reduced model (red)with dim. 2,5,10 and damping parameter d = 0.1,1,5 (top tobottom).

39 / 71

Page 43: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Consequences

. Continuous, discretized and reduced models close to physics.

. Conservation laws are included.

. Whole model hierarchy can be built in pHDAE form.

. A posteriori error estimates for DG discretization.

. Error estimates for model reduction the same as fordiscretization error.

. Reduced model can be added to model hierarchy.

40 / 71

Page 44: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outline

1 Motivation2 Application: Gas transport networks3 Energy based modeling4 Gas transport pHDAE5 Power networks6 PHDAE formulation of generalized Kuramoto7 Other physical domains8 Conclusion

41 / 71

Page 45: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

DFG Priority program, SFB 910. Collaborative Research Center SFB 910, Control of

self-organizing nonlinear systems: Theoretical methods andconcepts of application with Theoretical Physics.Project: Analysis and computation of stability exponents fordelay differential-algebraic equations.

. DFG priority Programme 1984, Hybrid and multimodal energysystemsProject: Computational Strategies for Distributed StabilityControl in Next-Generation Hybrid Energy Systems with KaiStrunz, EE, TU Berlin

. Incorporation in global/local optimization framework.

. Coupling with gas and heat network in BMBF Project with N.Marheineke, J. Mohring, M. Schmidt, and industry.

Building the pHDAE model hierarchy. PhD students: Arbi MosesBadlyan, Riccardo Morandin

42 / 71

Page 46: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Power network representationEach node (generators, loads, prosumers, etc) is modeled as anoscillator with phase angle θ and rotational speed ω = θ.

The network is represented by an undirected, weighted graph(V , E). The weight of the edges correspond to characteristics ofthe transmission lines (e.g. the admittance).Assume: ω ≈ Ω operational speed.V. M., R. Morandin, S. Olmi, E. Schöll. Qualitative Stability and Synchronicity Analysis of Power Network Models in

Port-Hamiltonian form. arXiv:1712.03160

43 / 71

Page 47: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Instantaneous power model

mj θj θj = −dj θ2j − vj Ij + Pj , for 1 ≤ j ≤ n,

Ljk ıjk = −Rjk ıjk + vj − vk , for (j , k) ∈ E ,0 = −Ij +

∑k :(j,k)∈E

ıjk , for 1 ≤ j ≤ n.

θj phase angle of jıjk current from j to kvj voltage of j (= |Vj | cos θj)Ij current leaving jPj power balance in j

mj inertia of jdj damping constant of jLjk inductance in (j , k)Rjk resistance in (j , k)

44 / 71

Page 48: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Real power model

Simplification I: Real power model. Near steady-state (long time without disturbances);. Transmission line resistance R ≈ 0;. Energy storage in inductors is ignored;. Electrical ‘instantaneous’ power substituted by real power

(average over time).This allows to ignore the electrical part for the dynamics.

mj θj θj = −dj θ2j +

∑nk=1 gjk sin(θk − θj) + Pj , for 1 ≤ j ≤ n,

gjk =|Vj ||Vk |2ΩLjk

≥ 0 for (j , k) ∈ E , else gjk = 0.

Note that G = GT .

45 / 71

Page 49: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Kuramoto models

Simplification II, generalized Kuramoto model.Using θj ≈ Ω, one may consider the simplified system

mj θj = −dj θj +n∑

k=1

gjk sin(θk − θj) + Pj , for 1 ≤ j ≤ n.

Simplification III, standard Kuramoto model with inertia

mj θj = −dj θj + Kn∑

k=1

sin(θk − θj) + Ωj , for 1 ≤ j ≤ n.

46 / 71

Page 50: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Model hierarchy

Model hierarchy is currently being extended.

47 / 71

Page 51: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Complex order parameterThe complex order parameter

reiφ = 1n

∑nj=1 eiθj

r(θ1, . . . , θn) ∈ [0,1] measures synchronicity of the system.

Better to use

r 2 =1n2

n∑j,k=1

cos(θk − θj) ∈ [0,1].

48 / 71

Page 52: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Generalized order parameter

The kinetic energy of the system is K(θ) = 12

∑nj=1 mj θ

2j , so

K =n∑

j=1

mj θj θj =n∑

j=1

(−dj θ2j + Ωj θj)︸ ︷︷ ︸

damping and input

+n∑

j,k=1

gjk θj sin(θk − θj)︸ ︷︷ ︸12

ddt (

∑j,k gjk cos(θk−θj ))

.

To incorporate the network topology we define a newgeneralized order parameter

ξ = ξb,c(θ) :=1c

n∑j,k=1

gjk cos(θk − θj) + b

for b, c ∈ R chosen in optimal way.

49 / 71

Page 53: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outline

1 Motivation2 Application: Gas transport networks3 Energy based modeling4 Gas transport pHDAE5 Power networks6 PHDAE formulation of generalized Kuramoto7 Other physical domains8 Conclusion

50 / 71

Page 54: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

PH formulation

Write the generalized Kuramoto model as pH model

E x = (J(x)− R(x))Qx + Bu

with J = −JT , R = RT ≥ 0, QT E = ET Q and H = 12xT QT Ex .

We define x = (ω,ρ,σ) = (θ, cosθ, sinθ) and u = ω. Thus,

sin(θk − θj) = ρjσk − σjρk ,

cos(θk − θj) = ρjσk + σjσk ,[∑nk=1 gjk sin(θk − θj)

]j=1,...,n = DρGσ − DσGρ,

with Dρ = diag(ρ) and Dσ = diag(σ).

51 / 71

Page 55: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

PH formulationWe can write the generalized Kuramoto model as

Mx = −Dx − DσGρ+ DρGσ + Ω,

ρ = −Dσω,

σ = Dρω,

that is equivalent to previous model with

E = diag(M, In, In),

Q = diag(In,−G,−G),

J =

0 Dσ −Dρ

−Dσ 0 0Dρ 0 0

,B = [In 0n 0n]T ,

R = diag(D,0n,0n),

M = diag(m),

D = diag(d).

The Hamiltonian has not changed.

H(x) =12

xT QT Ex =12ωT Mω − 1

2ρT Gρ− 1

2σT Gσ.

52 / 71

Page 56: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

pHDAE formulationMake sure that the constraint ρ2

j + σ2j = 1 holds numerically by

adding equations

ρ2j + σ2

j − λj = 0, for j = 1, . . . ,n,

with λ1, . . . , λn Lagrange multipliers. This leads to the pHDAE[E 00 0

] [xλ

]=

([J 00 0

]−[R 00 I

])Q[xλ

]+

[B0

]u

with

Q =

0

Q 00

0 Dρ Dσ −I

53 / 71

Page 57: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Example: Italian power grid network

Simulations on the Italian power grid network.. Connected graph (V , E) consisting of n = 127 nodes and

e = 171 edges;

. We set gjk =

10 if (j , k) ∈ E ,0 else

for j 6= k , and gjj = −∑

k 6=j gjk

for j = 1, . . . ,n;. We set all inertia constants mj = m = 6 and damping

constants dj = d = 1;. We choose randomly 34 nodes as generators

(Ωj = Ωgen = 2.7353) and all other nodes as consumers(Ωj = Ωload = −1).

54 / 71

Page 58: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Numerical integratorsExample: implicit midpoint rule (IMP).

LemmaGiven PH system with E invertible or pHDAE of differentiationindex one, then the IMP with step size h yields

H`+1 −H` = −h4

(x `+1 + x `)T QT RQ(x `+1 + x `) ≤ 0.

In particular, if R = 0 the Hamiltonian is preserved.

Since ρ2j + σ2

j is the Hamiltonian of a pH subsystem withoutdissipation, we expect the constraint to be well preserved.In general: We need new classes of pHDAE integrators:. E. Celedoni and E.H. Høiseth, Energy-Preserving and Passivity-Consistent Numerical Discretization of Port-Hamiltonian

Systems, arXiv:1706.08621v1

. P. Kotyczka, L. Lefevre, Discrete-time port-Hamiltonian systems based on Gauss-Legendre collocation. Proceedings of the6th IFAC Workshop on Lagrangian and Hamiltonian Methods for Nonlinear Control, Valparaíso, Chile, May 1–4, 2018

55 / 71

Page 59: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Constraint preservation

Numerical solution for Lagrange multiplier µ: Symplectic Euler(SE), Implicit Midpoint (IMP), Explicit Midpoint (EMP)). Orangeand magenta, different convergence thresholds 10−6 and 10−12.

56 / 71

Page 60: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Order parameters vs K

57 / 71

Page 61: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Control of synchronization

58 / 71

Page 62: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outline

1 Motivation2 Application: Gas transport networks3 Energy based modeling4 Gas transport pHDAE5 Power networks6 PHDAE formulation of generalized Kuramoto7 Other physical domains8 Conclusion

59 / 71

Page 63: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Brake Squeal

. Disc brake squeal is a frequent and annoying phenomenon(with cars, trains, bikes).

. Important for customer satisfaction, even if not a safety risk.

. Nonlinear effect that is hard to detect.

. The car industry is trying for decades to improve this, bychanging the designs of brake and disc.

Can we do this model based?60 / 71

Page 64: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Model based approachInterdisciplinary project with car manufacturers + SMEsSupported by German Minist. of Economics via AIF foundation.N. Hoffmann, TU Hamburg-Harburg, Mechanics, V.M. TU BerlinMathematics, U. von Wagner, TU Berlin, Mechanics.Goals:. Develop model of brake system with all effects that may cause

squeal. (Friction, circulatory, gyroscopic effects, etc).. Simulate brake behavior for many different parameters (disk

speed, material geometry parameters).. Project on space assoc. with squealing evs.

. Optimization: Layout of shims.. N. Gräbner, V. M., S. Quraishi, C. Schröder, U. von Wagner, Numerical methods for parametric model reduction in the

simulation of disc brake squeal ZAMM, Vol. 96, 1388U-1405, 2016.

61 / 71

Page 65: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

FE model detailsLarge differential-algebraic equation (DAE) systemdep. on parameters (here only disk speed displayed).

Mq + (C1 +ωr

ωCR +

ω

ωrCG)q + (K1 + KR + (

ω

ωr)2KG)q = f ,

. q vector of FE coefficients.

. M symmetric, pos. semidef., singular matrix,

. C1 symmetric matrix, material damping,

. CG skew-symmetric matrix, gyroscopic effects,

. CR symmetric matrix, friction induced damping,(phenomenological)

. K1 symmetric stiffness matrix,

. KR nonsymmetric matrix modeling circulatory effects,

. KG symmetric geometric stiffness matrix.

. ω rotational speed of disk with reference velocity ωr .62 / 71

Page 66: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

PHDAE formulationFE model of disk brake (simplified M,K > 0)

Mq + (D + G)q + (K + N)q = f .

Rewrite as perturbed pHDAE system z = (J − RD)Qz − RNQz,where

J :=

[G K + 1

2N−(K + 1

2NH) 0

], Q :=

[M 00 K

]−1

,

R := RD + RN =

[D 00 0

]+

[0 1

2N12NT 0

].

Instability and squeal arises only from indefinite perturbationterm RNQz. Change the damping to avoid instability?Perturbation N is restricted (to FE nodes on pad).

63 / 71

Page 67: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Spectral projection

Use spectral functions for Galerkin projection to get a reducedorder model.

. Project QEP:Pω(λ)v(ω) = (λ2M + λC(ω) + K (ω))v(ω) = 0 intosmall subspace spanned by Q independent of ω.

. Projected QEPI Pω(λ) = QT Pω(λ)Q = λ2QT MQ + λQT C(ω)Q + QT K (ω)Q

. How to choose Q?I Sufficiently good approximation of evs with pos. real part;I Ideally Q should contain good approximations to the desired

evecs for all parameter values;I Construct Q in a reasonable amount of computing time.

64 / 71

Page 68: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Space generation. Construct a measurement matrix V ∈ Rn,km containing

’unstable’ evecs for a set of parameters ωi ,

V = [V (ω1),V (ω2),V (ω3), ...V (ωk )]

. Perform (partial) singular value decomposition (SVD) (cheap)V = UΣZ H

V ≈ [u1, u2, . . . , ud ]

σ1

σ2

σ3. . .

σd

[z1, z2, . . . , zd ]H

by omitting singular values that are small.. Choose Q = [u1, u2, . . . , ud ] to project Pω(µ).. Adapt sampling set.

65 / 71

Page 69: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Results with new Galerkin methodIndustrial model 1 million dof, Python and MATLABimplementation.

. Solution for every ωI Solution with 300 dimensional TRAD subspace ∼ 30 secI Solution with 100 dimensional POD subspace ∼ 10 sec

66 / 71

Page 70: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Reactive flows/thermodynamics

. Navier-Stokes with reaction: R. Altmann und P. Schulze Aport-Hamiltonian formulation of the Navier-Stokes equationsfor reactive flows Systems Control Lett., Vol. 100, 2017, pp.51-55.

. Flows and Thermodynamics: A. M. Badlyan, B. Maschke, C.Beattie, and V. M., Open physical systems: from GENERIC toport-Hamiltonian systems, Proceedings of MTNS, 2018.

. Transport dominated problems: J. Reiss, P. Schulze, J.Sesterhenn, and V. M., The shifted proper orthogonaldecomposition: A mode decomposition for multiple transportphenomena. SIAM Journal Scientific Computing, 2018.https://arXiv:1512.01985v2

67 / 71

Page 71: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outline

1 Motivation2 Application: Gas transport networks3 Energy based modeling4 Gas transport pHDAE5 Power networks6 PHDAE formulation of generalized Kuramoto7 Other physical domains8 Conclusion

68 / 71

Page 72: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Summary

. Goal oriented modeling, simulation, optimization.

. Model hierarchies.

. Energy based modeling for networks of multi-physicsmulti-scale problems.

. DAE formulation of PH systems.

69 / 71

Page 73: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Outlook

Many things To Do:. Other physical domains.. Big Data handling.. Real time control, optimization.. Incorporate stochastics in models.. Better time-discretization methods.. Model reduction for all components.. Uncertainty quatification.. . . .

70 / 71

Page 74: Port-Hamiltonian modeling, simulation, and optimization ... · Port-Hamiltonian modeling, simulation, and optimization for coupled multi-physics and multi-scale systems Volker Mehrmann

Thanks

Thank you very muchfor your attention

and my sponsors for their support

. ERC Advanced Grant MODSIMCONMP

. Research center MATHEON, Einstein Center ECMath.

. DFG collaborative Research Centers 910, TRR154.

Details: http://www.math.tu-berlin.de/?id=76888

71 / 71