{'fraction_non_alphanumeric': 0.04532329229134422, 'fraction_numerical': 0.015431171891242578, 'mean_word_length': 4.461771385314156, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Space-time POD-Galerkin approach for parametric flow control

In this contribution we propose reduced order methods to fast and reliably solve parametrized optimal control problems governed by time dependent nonlinear partial differential equations. Our goal is to provide a tool to deal with the time evolution of several nonlinear optimality systems in many-query context, where a system must be analysed for various physical and geometrical features. Optimal control can be used in order to fill the gap between collected data and mathematical model and it is usually related to very time consuming activities: inverse problems, statistics, etc. Standard discretization techniques may lead to unbearable simulations for real applications. We aim at showing how reduced order modelling can solve this issue. We rely on a space-time POD-Galerkin reduction in order to solve the optimal control problem in a low dimensional reduced space in a fast way for several parametric instances. The proposed algorithm is validated with a numerical test based on environmental sciences: a reduced optimal control problem governed by viscous Shallow Waters Equations parametrized not only in the physics features, but also in the geometrical ones. We will show how the reduced model can be useful in order to recover desired velocity and height profiles more rapidly with respect to the standard simulation, not losing accuracy.

constraint. In the next Section, we will introduce optimal control theory in a parametrized setting, addressing the great importance of a such mathematical model in scientific and engineering contexts.

Introduction
This Chapter deals with parametrized optimal control problems (OCP(µ)s) governed by time dependent nonlinear parametrized partial differential equations (PDE(µ)s). Optimal control is a versatile mathematical tool which has been exploited in many fields of applications: shape optimization, see e.g. [25,32,56], fluid dynamics, see e.g. [23,57,60,22], heamodynamics [10,43,81,91], environmental predictions [63,64,77,81] and more. In a parametrized setting, where a parameter µ ∈ P ⊂ R d could represent physical or geometrical features, OCP(µ)s are exploited in order to study different configurations, which can be used to better understand the phenomenon one is dealing with. The main motivation for using OCP(µ)s relies in the need of simulations which have to be similar to a given observation or collected data. If on one hand, OCP(µ)s can be useful in many research fields, on the other, they are very complex and demanding from a computational point of view and this issue limits their applicability, most of all in a time dependent framework. Time dependence in OCP(µ)s has been widely described in literature, see e.g. [34,37,44,72,75,76]. In this context, the required computational resources for OCP(µ)s simulations drastically increase, and parametrized simulations can be unbearable to be performed with standard discretization techniques. To achieve a real-time OCP(µ) model, able to reconstruct observable profiles varying with respect to a parameter, a rapid and suitable approximation technique is needed. To this end, we rely on reduced order methods (ROMs). This discretization approach builds a low dimensional framework which can be exploited in order to solve several parametric instances to give real-time information on the model at hand. Working in this reduced space allows us to solve the parametrized optimality system in a small amount of time, by reducing the involved computational costs: for an introduction to the methodology the interested reader may refer to [7,13,33,61,67,68,62], for example. If we focus on OCP(µ)s applications, there is a wide production concerning steady linear governing equations, see e.g. the following far-from-exhaustive list [8,9,24,27,38,39,40,41,57,58,64]. Then, the consolidated knowledge about ROM for steady OCP(µ)s has been extended to time dependent OCP(µ)s: moving from [34,75,76,90] as a starting point, in [37,79,80,81] the main effort is to enlarge the model in a parametrized setting, and generalize the standard algorithm used to build the reduced space framework to time dependency. From now on, we will only focus on POD-Galerkin approach. The motivation relies in its versatility, since it can be even applied to every kind of governing equations: see e.g. [59,81,91] for POD employed in steady OCP(µ)s for nonlinear governing equations, or [78] for the application of such an algorithm to a space-time nonlinear OCP(µ). In this contribution, the proposed techniques have been tested through parametrized numerical simulations given by distributed control for viscous Shallow Waters Equations (SWEs), a model capable to simulate coastal current behaviour and used in environmental sciences for monitoring plans.
We aim at providing a space-time POD-Galerkin strategy for time dependent nonlinear OCP(µ)s. This work is outlined as follows. In Section 3, we introduce the theoretical formulation for OCP(µ)s following [36] and [84], focusing on time dependent nonlinear problems. Furthermore, a brief introduction of the space-time algebraic formulation is presented. Section 4 deals with the main idea behind reduced order approximation [33] and with its application to space-time nonlinear OCP(µ)s. When dealing with the numerical approximation of time dependent nonlinear OCP(µ)s, we will restrict ourselves to the case of semi-linear PDEs with quadratic nonlinearity in the state variable, to comply with the numerical test presented in Section 5: an application in coastal marine management through an OCP(µ) governed by SWEs. The proposed numerical test is inspired by [78], but in this case we consider not only physical, but also geometrical parametrization. Conclusions follow in Section 6.

Nonlinear Time Dependent Parametrized Optimal Flow Control Problems
This Section provides the continuous formulation for nonlinear time dependent OCP(µ)s. We will introduce the Lagrangian approach technique [31,36] to minimize a quadratic cost functional constrained to nonlinear time dependent PDE(µ)s. We remark that the analysis is still valid in the Banach spaces setting, but for the sake of clarity, we will restrict ourselves to the simpler case of the real Hilbert spaces.
3.1. Problem Formulation. Let us suppose to have a spatial domain Ω where a physical event described by a time dependent nonlinear PDE(µ) occurs. In order to mathematically represent such an evolution in the time interval [0, T ], we define the spaces for Y Hilbert space. Indeed, we are provided by a nonlinear state equation G : Y × P → Q * of the form where y := y(µ) ∈ Y is the state variable, namely the physical quantity we are interested in, while f ∈ Q * is a forcing term and P ⊂ R P is a parameter space of dimension P ≥ 1, which can describe physical and/or geometrical features of the system at hand. Moreover, we call L(·, ·) the space of the continuous linear functions between two spaces. The considered PDE(µ)s present the following form: where E ∈ L(Y, Q * ) and E n represent the linear and nonlinear contributions to the equation, respectively. The term y t describes the time evolution of the equation. We now want to change the behaviour of the state variable steering it to a desired profile, say y d := y d (µ) ∈ Y obs ⊇ Y, thanks to the action of a control variable u := u(µ) ∈ U, where U = L 2 (0, T ; U ) with U another Hilbert space. Thanks to all the previous definitions, we are able to define the controlled equation E(y, u; µ), where E : Y × U × P → Q * of the form: where C ∈ L(U, Q * ) is related to the control variable action on the system in order to change the original state variable. The OCP(µ) reads: given a µ ∈ P, find the pair (y, u) ∈ Y × U which solves and α ∈ (0, 1] is a penalization parameter. It is clear that the smaller is the value of α, the more the control variable will influence the system. Problem (5)  (i) U ad is convex, bounded and closed; (ii) Y ad is convex and closed; (iii) for every µ ∈ P, the controlled system E(y, u; µ) = 0 has a bounded solution map u ∈ U → y(u) ∈ Y; (iv) for a given µ ∈ P, the map (y, u, µ) ∈ Y × U × P → E(y, u; µ) ∈ Q * is weakly continuous with respect to (w.r.t.) the first two arguments; (v) for a given y d ∈ Y obs , the cost functional J(y, u; y d ) is weakly lower semicontinous w.r.t. the first two arguments.
To apply the Lagrangian theory, we define z := z(µ) ∈ Y * * = Y ⊂ Q be an arbitrary adjoint variable, which allows to translates the (5) in an unconstrained minimization problem. Indeed, calling with X := X(µ) = (y(µ), u(µ), z(µ)) ∈ X := Y × U × Y the global variable of the system at hand, we can build the Lagrangian functional L : X × Y obs × P → R as where with ·, · QQ * we mean the duality pairing between Q and Q * . Let us assume that the following hold: the first two arguments; (viii) given µ ∈ P, the controlled system E(y, u; µ) = 0 has a unique solution y = y(u) ∈ Y for all u ∈ U; (ix) given µ ∈ P, D y E(y, u; µ) ∈ L(Y, Q * ) has a bounded inverse for all control variables u.
From (ix), it is clear that D indicates the Fréchet derivative w.r.t. a variable and we will exploit this notation from now on. Thanks to hypotheses (vi) -(ix), given a solution (y, u) ∈ Y × U of (5) for a given µ ∈ P, there exists an adjoint variable z ∈ Y which satisfies the following optimality system [36]: or equivalently, in strong form where D y E(y, u; µ) * ∈ L(Q, Y * ) is the adjoint operator of the Fréchet linearization of E(y, u; µ) w.r.t the state variable, while C * ∈ L(Y, U * ) is the adjoint of the control operator. Furthermore, the system (8) can be recast in compact form: given µ ∈ P, find X ∈ X such that We underline that the dual variable z is considered in Y in order to guarantee a proper definition of the optimality system due to the presence of a backward time evolution of the form −z t in the expression of D y E(y, u; µ) * . In this context, we will always assume that the state equation is local invertible for every parametric instance, i.e. assumptions (viii) and (ix) always hold. We underline that in the nonlinear case it may happen to find multiple solutions for a given parameter. However, it will not be the case of this work, since we are restricting ourselves to a well-posed setting for the state equation. Indeed, we stress that in the nonlinear case it is only possible to recover existence results for the system (5). Uniqueness results are strongly related to the state equation one is dealing with and multiple solutions for the optimality system (10) can be found, see for example [59].
In the next Section, we will show the space-time approximation of the optimality system at hand, generalizing the strategy already presented in [28,85,88,89]. We will focus on the case of semilinear governing equations with quadratic dependence in the state variable, guided by the numerical results provided in Section 5.
3.2. The Space-Time Approximation. The next step to be taken is the numerical approximation of the optimal solution X of (10) in order to investigate its features varying µ ∈ P in a space-time fashion. This approximation approach is a versatile tool already exploited in the discretization of parabolic equations and several OCP(µ)s, see e.g. [28,34,36,35,42,79,80,78,88,89,85]. We first focus on the space discretization, which is performed through the Finite Element (FE) technique. Let us define the FE function space with P r is the space of all the polynomials of degree at most equal to r and K is an element of a triangularization T of the spatial domain Ω. We can now consider the semi-discrete function spaces Once made the spatial discretization step, a time discretization over the interval [0, T ] must be taken into account resulting in the final space-time discrete spaces, which are where N t is the number of the considered timesteps. Following [42], we decided to use the same space-time approximation for Y Nt . For the sake of notation, we will refer to the space-time function spaces as Y Ny ≡ Q Ny and U Nu and, as a consequence, In this finite dimensional setting the problem to be solved reads: given µ ∈ P and observation y N d ∈ Q Ny find X N := X N (µ) ∈ X N such that (11) G(X N ; µ) = F.
In the following, we make clear the algebraic structure we exploited in the numerical experiment presented in Section 5.1. First of all, let us divide the time interval [0, T ] in N t equispaced subintervals of length ∆t and let us call t k = k∆t for k = 0, . . . , N t a generic time instance. The variables y N k m u N k and z N k for a specific timestep, can be represented with FE basis and U N u FE , respectively as follows We now define the space-time state, control and adjoint vectors Namely,ȳ k ,ū k andz k are the column vectors with FE coefficients of the variables at time instance t k , with k = 1, . . . , N t , i.e.
Applying the same strategy to the initial time condition, to the desired state and the forcing term, we can define respectively, whereȳ 0 ,ȳ dk andf k , in analogy with the aforementioned space-time variables, are the column vectors given by the FE coefficients in their respectively function spaces, with k = 1, . . . , N t . We begin the discretization analysis from the state equation, for the sake of clarity. Concerning the space discretization level, once applied the controlled equation to the FE basis, we can derive the matrices E n (y; µ) + E (µ) − C, omitting for the moment the time evolution. Furthermore, we need the mass matrices M y and M u for state/adjoint variables and control, respectively. At every time instance, after performing a backward Euler discretization in time, we have to solve the following system: Thus, the whole space-time system reads We underline that the system presents a nonlinear dependence from the state in the term E n (µ), related to the nonlinear contribution of the state operator E n (y; µ). The space-time state equation can be written in compact form as where the subscript "st" indicates the all-at-once matrices, namely C st is the block-diagonal matrix which entries are given by C of dimension R Ny × R Nu and M y st is the matrix made by M y on the diagonal, of dimension R Ny × R Ny . We now take into account the optimality equation, which easily reads: or in compact form We can now take into account the adjoint equation. To this purpose, we have to explicit the algebraic structure of D y E(y, u; µ). The assumption of the quadratic nonlinearity in the state variable gives the following form to the Fréchet derivative of the controlled state equation with respect to the state y: E n [y](µ) + E (µ), where the linear state structure remains the same, while the nonlinear operator is linearized in E n [y]. It is clear that the control operator C has to disappear since it does not depend on the state variable. Thus, performing a forward Euler method which is equivalent to an implicit scheme due the backward parabolic nature of the adjoint equation, at each time instance it reads: where M obs is the state mass matrix restricted to the observation domain. We stress that E adj (µ) hides the state variable dependence. Futhermore, also in this case, we can write the whole all-at-once system: Then, in a more compact notation, the adjoint equation reads: where M obsst ∈ R Ny × R Ny is the block-diagonal matrix which entries are given by M obs . Finally, we are able to collect all the information and build the global all-at-once system: We remark that the nonlinearity of G(X; µ) derives from K(y; µ) and K (µ), due to the nonlinear terms E n (y; µ) and E n [y] T (µ). However, for the sake of notation, we omitted the direct X−dependence from the matrices. The nonlinear system, then, can be recast in residual formulation as (20) R(X; µ) := G(X; µ) − F = 0, where R(X; µ) will be called the global residual of the optimality system. To solve system (20), we employed Netwon's method: namely we iteratively solve until a residual based convergence criterion is satisfied. We recall that the matrix K (µ) still depends on the state vector y in the term E n [y] T . Then, the linearization w.r.t. y of K (µ) leads to a new term in the formulation: Namely, the Jacobian matrix will have the following form: where each matrix taken into consideration is now linear in the j−th value of one of the involved variables and K l (y j ; µ) is the linearized version of K(y, µ). Thanks to this remark we are able to show the saddle point structure of the system at hand. Indeed, equation (23) can be written as The proposed framework is very common in many CFD applications, from Stokes equations to PDEs contrained optimization. In the saddle point setting, following the Brezzi theory [15], to guarantee the existence of a unique solution of (24), the matrix A should be invertible and the following Brezzi inf-sup condition should be verified [14,15]: For linear state equations hypotheses (i)-(ix) assure the well-posedness of the saddle point structure [36,57,58,79]. This is not the case for nonlinear settings, where the where the fulfillment of (i)-(ix) does not ensure uniqueness and the Brezzi theorem should be verified from case to case. In the FE context, the inequality (26) holds when the function spaces for state and adjoint coincide [57,58]. The assumption z ∈ Y, will guarantee the fulfillment of the inf-sup stability condition in the space-time approximation once provided at the continuous level. It is clear that in order to solve the all-at-once optimization problem in a parametrized setting, for a given µ ∈ P, we have to deal with a high-dimensional systems. The solution of many-query and/or real-time tasks require growing computational resources and computational time for simulations. In this context, the space-time approximation has some limitations most of all when one relies, as in our case, on the direct solution of the optimality system. To lighten this issue, besides the employment of more computational resources, proper preconditioners and multigrid approaches cen be used, see e.g. [14,71,75,76] and the references therein. In the next Section we will introduce ROMs for space-time nonlinear OCP(µ)s, providing a general approximation strategy which can solve the issue of the huge amount of computational costs that are usually associated to a standard space-time solution process.

ROMs for Nonlinear Space-Time OCP(µ)s
This Section introduces ROMs for nonlinear space-time OCP(µ)s. We refer to [77,81,91] for previous contributions to ROM for nonlinear OCP(µ)s and to [78] for their extension to time dependent nonlinear governing equations. First, we introduce the ROMs ideas and we will briefly focus on the standard approaches to make the strategy effiecient in terms of computational resources. Then, we will describe the POD-Galerkin basis construction algorithm, see [11,13,16,18,33] as general references. We will exploit the classical aggregated spaces technnique, following the linear OCP(µ)s fashion, as already presented in [8,9,24,27,39,40,57,58,64]. We underline that the proposed strategy is strictly related to the linear quadratic case, i.e. OCP(µ)s governed by linear PDE(µ)s with a quadratic cost functional. However, it represents a classic choice to deal with more general nonlinear frameworks, see e.g. [62].

General Reduction Strategy.
In Section 2, we introduced the importance of parametric optimal control in several field of applications. Parameters can represent physical features and/or geometrical ones and, in many-query and real-time contexts, there exists the need to study several parametric instances to better understand the properties of a system. For this task, the spacetime formulation can be unbearable and limit the knowledge capability of OCP(µ)s due to the huge amount of computational resources needed for their simulations. The ROM aim at building a low-dimensional surrogate function space, in order to decrease the needed time for a simulation, guaranteeing a better parametric analysis in a small amount of time. We now provide the main ROM ideas for OCP(µ)s. Let us consider the global variable X(µ) = (y(µ), u(µ), z(µ)), parametric solution of (10). In this Section we make the parameter dependence explicit, for the sake of clarity. Indeed, it will be useful to understand the basics and main features of this discretization approach. The first phase of the ROM relies in the construction of basis functions to represent the high fidelity solution X N (µ). This goal is reached through the employment of snapshots, i.e. properly chosen solutions of (11). The low-dimensional function space is a subset of X N and in order to solve the optimality system for a new value of µ ∈ P it is sufficient to perform a standard Galerkin projection over the reduced space. In the following, we assume to have already built the reduced space 1 for the global variable X(µ), say X N ⊂ X N . We stress that the reduced dimension N verifies N N . The building procedure is part of the offline phase where not only the basis functions are computed, but also the µ-independent quantities are assembled and stored. Once the offline phase is concluded, the reduced optimality system reads: given µ ∈ P, find The solution is given in an online phase, where for every new evaluation of µ ∈ P, the optimality system (27) is assembled and solved. From the latest arguments, it is natural to deduce that one of the main ingredients of this procedure is the efficient division between a possibly expensive offline phase, which is performed only once, and a fast projection phase to solve the system for several parameters. This may be possible if we assume an affine decomposition for (27), i.e. the involved equations have the following form: In other words, the system can be recast as the product of µ−dependent smooth functions Θ q y (µ), Θ q u (µ), Θ q z (µ) and µ−independent forms D y L q (X N , When this is the case, the online phase does not depend on N and usually guarantees the solution of the system in a small amount of time. Remark 4.1. For nonlinear systems, even if structure (28) is fulfilled, the involved nonlinear forms still depend on X N (µ) and this affects the computational advantage in using a POD-Galerkin approach, since it involves the assembly (and projection) of the high fidelity solution during the online stage. To overcome this issue, hyper-reduction techniques based on the Empirical Interpolation Method (EIM) may be employed, see e.g. [12] or [33,Chapter 5].
In the next Section, we will describe the space-time POD-Galerkin strategy to build the reduced space X N .

Offline and Online phase: from Space-Time POD Algorithm for OCP(µ)s to Galerkin
Projection. The ROM building process has mainly been addressed through two techniques: the POD [11,16,18,33] and the greedy algorithm [27,33,57,58,69]. In this work, we will focus on the first one since it can be applied to any state equation: indeed, greedy constructions are based on the employment of an error estimator, which is still not available for nonlinear time dependent OCP(µ)s. The POD-Galerkin algorithm samples N max parameters in P and computes the related snapshots. After this exploratory phase, a compressing stage starts, where N < N max basis functions are provided after snapshots manipulation, aiming to get rid of the redundant information in the parametrized system. Let us define the subset P Nmax ⊂ P given by the sampled parameters, which has cardinality N max . The chosen snapshots will form the following sampled manifold where we assume N max large enough to let M N Nmax be a reliable representation M N . The POD algorithm is applied separately for each involved variable, in a partitioned space-time approach, where the procedure provides spaces of dimension N which minimizes the following quantities: In the following we describe the snapshots manipulation to build the reduce space only for one variable, say the state y(µ). The proposed arguments can be identically replied for the other variables as well. First of all, we consider the ordered set of parameters µ 1 , . . . , µ Nmax ∈ P Nmax to which correspond a set of order snapshots y Ny (µ 1 ), . . . , y Ny (µ Nmax ). The correlation matrix C y ∈ R Nmax×Nmax of snapshots of the state variable, i.e.: First, we solved the following eigenvalue problem: with x y n Y = 1. Let us assume to have sorted the eigenvalues λ y 1 , . . . , λ y Nmax in decreasing order and to consider only the first N ones, namely λ y 1 , . . . , λ y N , and the corresponding eigenvectors x y 1 , . . . , x y N . Let (x y n ) m be m-th component of the state eigenvector x y n ∈ R Nmax . Thus, the POD basis functions are given by the following relation: The relation (29) is standard in data-compression algorithms such as POD, see e.g. [33,62] . It represents how the bases can be written in terms of the POD eigenvalues-eigenvectors pairs. We remark that the time instances are not separated in the POD procedure: i.e. the snapshots preserve the space-time structure. The values N max and N can be guided by the analysis of the POD eigenvalues, since the following holds [33,62]: where P N : Y → Y N is the projection for functions in Y onto the reduced space Y N . Another aspect to take care of is the sampling of the N max parameters for the POD, which can be related to some previous knowledge one has of the system at hand. As already specified in Section 3.2, the linearized OCP(µ) leads to the solution of a saddle point system at each iteration of the Newton's method. To prove the existence and uniqueness of the solution, the matrix B of system (24) must verify the inf-sup stability condition (26) for every µ ∈ P. The relation, at the space-time level, holds thanks to the same discretization technique used for state and adjoint variable. However, this assumption does not guarantees the fulfillment of the inf-sup stability at the reduced level. Indeed, the basis has to be manipulated in order to achieve this goal since the standard space-time POD process may lead to different reduced spaces for state and adjoint, even if the high fidelity discretization is the same for both the variables. To overcome this issue, we exploit aggregated spaces technique. This strategy is very common and well known in ROM literature for OCP(µ)s, see [8,9,24,27,39,40,57,58,64] as references. The main idea is to build a common function space which represents both state and adjoint variables (31) Y N = span {χ y n , χ z n , n = 1, . . . , N }, while for the control variable we rely on the standard space (32) U N = span{χ u n , n = 1, . . . , N }. We can now define the basis matrix The Z spans the reduced space X N . In this framework we can solve the optimality system in a small amount of time for every parametric instance through a Galerkin projection into the reduced spaces. Thus, the final system reads: The system (33) inherits the nonlinearity feature from the high fidelity one and the Newton's method can be employed also in this case presenting the saddle point structure for the Frechét derivative, i.e.
In the reduced framework, the reduced inf-sup condition reads (36) β N (µ) := inf which is verified due to the aggregated spaces definition. It is known that using the state and adjoint function spaces built on their respective snapshots without any kind of manipulation might be not sufficient to guarantee the well-posedness of a linear saddle point system (35). Indeed, by means of standard POD function spaces, the fulfillment of (36) is not assured. To avoid this issue, we follow the strategy already employed in [58] and previously in [24]: we use the same space for state and adjoint, made by the union of the two different bases obtained by the POD applied to state and adjoint, respectively, as defined in (31). We remark that, even if the reduced system increases its final dimension through this approach, it is usually much smaller then N . Moreover, it is clear that to have a good reduced approximation, the high fidelity solution must be a good representation of the continuous framework. However, as already specified in Section 3, it has to be verified case by case. This kind of analysis goes beyond the goal of this contribution and we will always assume that the space-time approximation is a valid discrete representation of the continuous problem. In the next Section we will show with some numerical examples on how convenient ROMs can be in the framework of space-time nonlinear OCP(µ)s.

Application to Shallow Waters Equations
This Section shows how the previously proposed methodologies can be applied to the viscous SWEs model. We stress that the described strategies are general and can be applied to several state equations. Furthermore, they easily adapt to simpler settings like steady and/or linear problems, which are still useful in many engineering and scientific fields, as already specified in Section 2. However, in the following, we will focus on environmental sciences and, more specifically, in coastal management: a growing impact field of research that needs the support of accurate real-time simulations. To this end, first, we will introduce the viscous SWEs state equations and some motivations for the primary importance of such a model in coastal fluid dynamics. Then, we will briefly describe the optimality system formulation at the continuous level before proposing some numerical results to test our methodology in a physical and geometrical parametrized setting.

Main Motivations and Problem
Formulation. This Section is motivated by the growing demand of fast and reliable simulations in the framework of coastal management. Indeed, the marine environment is related to social and economic growth, biodiversity and ecosystem preservation, monitoring plans for possibly dangerous events related to weather factors or anthropic behaviour. The viscous SWEs result in a very versatile model in coastal sciences which can represent marine impact on shores and coasts, planetary currents, tsunamis waves... [17,87]. The state equation and the control problem have been studied analytically and numerically in several works, see for example [3,2,4,5,26,55,54,53,65,66,83]. In a parametrized setting, they have been explored as state equation in [73,74] and in [78] in an optimal control framework. First of all we define our parameter, µ = (µ 1 , µ 2 , µ 3 , µ 4 ) ∈ P ⊂ R 4 . The first three parameters are related to the physics of the problem, while the latter describes the geometry of the considered spatial domain: the specific description of the parametrized setting is postponed later in the Section. For this peculiar state equation, we define the function spaces ) and the space U = L 2 (Ω(µ 4 )), where Γ Dv (µ 4 ) is a portion of the boundary domain ∂Ω(µ 4 ) where Dirichlet boundary conditions have been imposed. The involved variables are the vertically averaged velocity profile of the wave v and the surface elevation variable h, respectively considered in Y v and Y h . We will focus on the simpler setting, where the bottom bathymetry z b is defined as a constant function: it can be generalized to more realistic bathymetry, see e.g [26,66,65]. In Figure 1 we provide a description of the physical phenomenon we are dealing with, together with the notations we will exploit. We used the standard 2D-model presented in [2,55]. The state solution valocity and height are defined, respectively, in . Thus, we can define the global state function space given by Y = Y v × Y h , where the state variable (v, h) will be sought. Furthermore, let u ∈ U := L 2 (0, T ; [U ] 2 ) be the control variable of the system.
For the numerical results, we will deal with a distributed optimal control, where the control variable acts as an external forcing term such as atmospheric pressure, bottom friction and wind action. Namely, you are not actually controlling the system but one can interpret the optimal control framework as an inverse problem capable to guess what are the physical conditions that can represent a desired velocity-height profile (v d , h d ) ∈ Y obs := Q v × Q h , where Q v := L 2 (0, T ; [L 2 (Ω(µ 4 ))] 2 ) and Q h := L 2 (0, T ; L 2 (Ω(µ 4 ))). The problem at hand reads: given µ ∈ P find (v, h) ∈ Y which minimizes J ((v, h), u, (v d , h d ) constrained to the following equation we can interpret the first equation as a sum of terms in L 2 (0, T ; [Y v * ] 2 ). We now focus on the second equation. Using standard regularity results for Navier-Stokes equations [19], h is in L 2 (0, T ; Y v ). Exploting Sobolev embedding theorems in dimension three (considering space and time), we have hv ∈ L 2 (0, T ; [Y h ] 2 ) and, consequently, div(hv) ∈ L 2 (0, T ; Y * v ). Thus, the second equation is a sum of terms in Even if the setting presented in Section 3 includes a broad class of state equations, to the best of our knowledge no results about OCP(µ)s governed by the twodimensional SWEs are known in the Lagrangian context. However, we believe that one could apply the same techniques already used in [36, Section 1.8.1] for Navier-Stokes equations to state the wellposedness of the problem and to recover hypothesis (i) -(ix). However, this topic goes beyond the goal of this contribution and we will restrict ourselves to the case of well-posedness for this specific test case. As already specified in Section 3, the value of α ∈ (0, 1] influences the control action: the smaller is α, the larger the action of the control variable is. The state equation (38) models free surface incompressible flows in hydrostatic pressure: this assumption is verified when shallow depths are considered, namely when the water height is much lower than the wavelength, which is classical for coastal phenomena. We deal with two physical parameters µ 1 and µ 2 representing diffusive and convective action of the system considered, respectively. Moreover, µ 3 will define the desired solution profile, while µ 4 , as already specified, will affect the spatial geometry we will deal with. Let us suppose to have recast the state equation (38) in weak formulation as E ((v, h), u; µ), thus we can define the following Lagrangian functional where the variable (z, q) ∈ Y is the adjoint variable. Here we do not specify all the bilinear forms involved, the interested reader may refer to [78]. The optimality system is, then, obtained through the differentiation with respect to the all involved variables. The minimization problem thus reads: For the sake of completeness, we report the system (40) in strong formulation: In the next Section we will present the numerical results for a distributed OCP(µ)s with physical and geometrical parameters. They are an extension of [78] to parametrized spatial domain. Furthermore, we will briefly discuss the high fidelity space-time approximation and how we perform a POD-Galerkin in this specific framework in order to build the reduced space approximation for this specific OCP(µ)s.

Numerical Results.
This Section aims at validating the performances of the POD-Galerkin projection reduced approch proposed in Section 4. We followed the test case presented in [26], recasting it in the parametrized setting briefly introduced in Section 5.1, where not only physical parameter is considered, but also the gemetry of the spatial domain changes with respect to the choise of µ ∈ P = (0.00001, 1.) × (0.01, 0.5) × (0.1, 1.) × (0.8, 1.5). Indeed, the spatial domain is given by Ω(µ 4 ) = [0, 10µ 4 ] × [0, 10]. In an inverse problem fashion, the optimal control setting gives information about the forcing term needed to achieve a given desired solution profile. To perform simulations and consequent reduction, we took into account a pull back of the optimality system (40)  Let us briefly analyse the high fidelity approximation. We exploited FE discretization, and the optimal solution fields have been discretized through linear polynomial, namely N y are the FE dimensions for state and adjoint velocity and height profile and control variable, respectively, obtained using r v = r h = 1, as proposed in [70]. The same polynomial degree has been exploited for the control variable, giving a FE discretization of dimension N u FE . Concerning the time approximation, we perform Euler methods, dividing the time interval N t = 8 timesteps, with a ∆t = 0.1s. The number of timesteps can be increased following the iterative techniques presented in [34,35,75,76]. Although, in this work, for the sake of simplicity and clearness, we exploited a direct solver for the optimality system (41) and this affects the resolution of the high fidelity approximation. In the end, at the truth approximation level, we deal with a system of a total dimension N = 76352, although, we underline that it is sufficient to validate the reduced approach proposed in Section 4. Let us focus our attention on the construction phase of the low dimensional function spaces. As specified in Section 4.2, we applied a partitioned approach, where several POD compressions, over the five different correlation matrices of N max = 100 snapshots have been carried out for all the involved variables.The number of snapshots N max was heuristically chosen observing that the POD eigenvalue decay is comparable to the one obtained by N max = 150, see Figure 2. Besides, we could not explore further the parametric space since the space-time approximation drastically affects the computational time needed for the offline phase of the POD algorithm, i.e. the snapshots collection. Then, the application of the strategy described in Section 4.2 will lead to the following spaces: For state and adjoint velocity-height variable we will use Z N = Z vz N ×Z hq N so that the inf-sup condition (36) holds. Indeed, we remark that, this strategy guarantees the reduced inf-sup stability condition (36) to be verified for the linearized problem at each step of the Newton's Method. Despite the increasing of the dimensionality, we will see that the performances of the reduced projection is still convenient with respect to the high fidelity simulations: comments on the computational advantages are postponed later in the Section. We stress that the used POD-Galerkin approach might be suboptimal for the state equation at hand as underlined in several works, see e.g. [30,82]. However, the proposed optimal control numerical setting does not suffer much the reduced representation: indeed we are dealing with a viscous model and, furthermore, the controlled framework seems to act itself as a sort of stabilization, where the forcing term changes in order to achieve a less convectiondominated solution. This is confirmed both by the comparison between projection-based ROM and best-fit projection averaged relative log-errors for a testing set of 20 uniformly distributed parameters of Table 1 and by the eigenvalue decay represented in Figure 2.
All the features of the offline and online phase of the experiment are reported in Table 2. Table 1. Projection-based ROM and best-fit projection averaged relative log-errors comparison.

Averaged relative errors proj-ROM Averaged relative errors best-fit projection
4.68e-2 5.42e-3 2.30e-2 5.26e-2 2.39e-2 2.52e-2 4.05e-3 1.17e-2 2.11e-2 2.21e-2 10 1.48e-2 2.28e-3 4.53e-3 1.28e-2 7.34e-3 1.22e-2 1.58e-3 4.47e-3 1.04e-2 5.89e-3 16 6.82e-3 9.01e-4 1.97e-3 5.72e-3 3.27e-3 5.65e-3 5.  The basis function considered allowed us to well describe the full order approximated system in the reduced framework, as the reader can notice from the average relative errors represented in Figure 3 with the following norms: The errors are averaged over a testing set of 20 parameters uniformly distributed: from the plots in Figure 3, one can observe how the POD-Galerkin approach leads to a good approximation of all the involved quantities. Indeed, using N = 30, state and adjoint velocity reach values around 2 · 10 −3 , while the relative error for control, state and adjoint elevation is below 10 −3 . Furthermore, the accuracy of the reduced model can be understood also from the comparison between the space-time solutions and the ROM solutions presented in Figures 5, 4 and 6 for state velocity, state elevation and control at t = 0.1s, 0.4s, 0.8s, respectively. Let us comment on the computational time performances between space-time approximation and ROM simulations. Indeed, not only the reduced basis are able to reproduce several time instances in an accurate way, but there is a gain in the computational time needed for parametrized simulations.  We call speedup index the number of reduced simulations which can be performed in the time of the solution of one high fidelity optimality system. For this specific test case, the speedup is of the order of O (20) for N = 1, . . . , 30, namely, it is lightly influenced by the reduced spaces dimension. The speedup index tells us that performing a Galerkin projection in the aggragated spaces is still convenient with respect the solution of the whole space-time OCP(µ). The saved computational time can be used to study and analyse several parametric configurations in a real-time or manyquery context. In the next Section some comments and conclusions follow.

Conclusions
In this contribution, we propose ROMs as a reliable and fast strategy to deal with parametrized nonlinear time dependent OCP(µ). The analysis we propose is general and can be applied to several PDE(µ)s constrained optimization processes. We described the optimality system used to reach a desired profile both at the continuous and discrete level, in a space-time fashion, presenting it not only from a theoretical point of view, but also in its algebraic form, underlining the hidden saddle point structure of the linearized system. Thus, we moved towards model order reduction in order to alleviate the issue of the complexity of the optimality system, which results in a high dimensional problem. We propose a space-time POD-Galerkin approach: the choice was led by the need of an algorithm which could be applied also to very complicated equations, such as the nonlinear time dependent optimality systems. This work relies in building a reduced framework for time dependent nonlinear OCP(µ)s, capable of filling the gap between data and physical model. We validate the method in environmental applications such as marine ecosystem management and coastal engineering, though a solution tracking optimization problem governed by viscous SWEs under physical and geometrical parametrization. Our aim was to show how ROMs could be a suitable tool to rapidly simulate marine environment, deeply characterized by a growing demanding computational effort. Indeed, the general proposed methodology results in fast simulations without paying in accuracy with respect to the time consuming space-time approximation. complex systems governed by Partial Differential Equations" (NA-FROM-PDEs) and the INDAM-GNCS project "Tecniche Numeriche Avanzate per Applicazioni Industriali". The computations in this work have been performed with RBniCS [1] library, developed at SISSA mathLab, which is an implementation in FEniCS [52] of several reduced order modelling techniques; we acknowledge developers and contributors to both libraries.