10 — From OpenHPL to Julia and ControlSystems.jl

This final note explains the analytical bridge from OpenHPL's nonlinear Modelica plant to a Julia control-study workflow.

1. Nonlinear reference model

Start from the detailed OpenHPL model

$$F(\dot x,x,z,u)=0.$$

Choose a plant configuration and operating point that corresponds to the physical unit and FCR service under study.

2. Solve the equilibrium

$$F(0,x^\star,z^\star,u^\star)=0.$$

The operating point should include steady flow, pressure, surge level, guide-vane position, turbine power, generator speed and electrical loading.

3. Obtain Jacobians

Form

$$E=\frac{\partial F}{\partial\dot x},\quad A=-\frac{\partial F}{\partial x},\quad B=-\frac{\partial F}{\partial u}.$$

If algebraic variables are explicit, eliminate them with the Schur complement as described in Article 08.

4. Export the reduced model

The target control model is

$$\Delta\dot x=A_r\Delta x+B_r\Delta u,$$ $$\Delta y=C_r\Delta x+D_r\Delta u.$$

These matrices can then be instantiated in Julia as a state-space model.

5. Transfer functions

Relevant channels include

$$G_{P_my_g}(s)=\frac{\Delta P_m}{\Delta y_g},$$ $$G_{fy_g}(s)=\frac{\Delta f}{\Delta y_g},$$ $$G_{fP_L}(s)=\frac{\Delta f}{\Delta P_L}.$$

6. Classical analysis

With ControlSystems.jl, the reduced model can be used for poles, damping ratios, step response, Bode plots, Nyquist plots, gain/phase margins and root-locus studies. The central question is whether the reduced model preserves the dominant OpenHPL modes in the FCR bandwidth.

7. Controller synthesis

A droop/servo controller can be represented as

$$G_c(s)=G_{droop}(s)G_{transient}(s)G_{servo}(s),$$

and the loop transfer function becomes

$$L(s)=G_c(s)G_{plant}(s).$$

Closed-loop sensitivity is

$$S(s)=\frac{1}{1+L(s)},$$

and complementary sensitivity is

$$T(s)=\frac{L(s)}{1+L(s)}.$$

8. Nonlinear verification

Controller conclusions from the reduced model must be checked again in OpenHPL:

$$u_c(t)\to\text{nonlinear OpenHPL simulation}.$$

Verify frequency response together with guide-vane limits, penstock pressure, surge-tank excursion, turbine operating point and water-hammer constraints.

9. Recommended workflow

$$\boxed{\text{OpenHPL}\to\text{equilibrium}\to\text{linearize}\to\text{reduce}\to\text{ControlSystems.jl}\to\text{controller}\to\text{OpenHPL validation}}$$

10. Research direction

This workflow gives a rigorous path for comparing a detailed equation-based hydropower model against the classical low-order transfer functions normally used for FCR qualification and load-frequency control. The difference between the two models is itself scientifically interesting: it quantifies which hydraulic nonlinearities and distributed modes matter for frequency-control performance.