An optimal control approach to determine resistance-type boundary conditions from in-vivo data for cardiovascular simulations

The choice of appropriate boundary conditions is a fundamental step in computational fluid dynamics (CFD) simulations of the cardiovascular system. Boundary conditions, in fact, highly affect the computed pressure and flow rates, and consequently haemodynamic indicators such as wall shear stress, which are of clinical interest. Devising automated procedures for the selection of boundary conditions is vital to achieve repeatable simulations. However, the most common techniques do not automatically assimilate patient-specific data, relying instead on expensive and time-consuming manual tuning procedures. In this work, we propose a technique for the automated estimation of outlet boundary conditions based on optimal control. The values of resistive boundary conditions are set as control variables and optimized to match available patient-specific data. Experimental results on four aortic arches demonstrate that the proposed framework can assimilate 4D-Flow MRI data more accurately than two other common techniques based on Murray's law and Ohm's law.


Introduction and motivation
In recent years, large improvements have been made in developing patient-specific computational models to predict blood flow in patients affected by various cardiovascular diseases [51,18]. The availability of data obtained from non-invasive medical imaging techniques, such as computed tomography (CT) and 4D Flow magnetic resonance imaging (MRI), combined with computational fluid dynamics (CFD), has led to more realistic blood flow modeling, with the possibility of investigating the origin and mechanisms behind different cardiovascular diseases.
Mathematical models usually describe blood flow through Navier-Stokes equations, which for complex geometries, such as 3D models of the cardiovascular system, need to be solved numerically. Since it is unfeasible to discretize the entire cardiovascular system, Navier-Stokes equations are solved only on a portion of it, while the rest of the vasculature is accounted for by proper boundary conditions (BCs). Boundary conditions, in fact, model the upstream and downstream vasculatures not included in the 3D model by specifying the physiological conditions at the inlets and outlets of the computational domain of interest. An example of computational model for a human aortic arch can be found in Fig. 1, where the boundary conditions have to be imposed at the inlet Γ in and at the four outlets comprising the descending aorta (DAo) and the supra-aortic branches: brachiocephalic artery (BCA), left common carotid artery (LCC), and left subclavian artery (LSUB). The selection of appropriate boundary conditions is always a crucial step when  dealing with patient-specific cardiovascular models. Several studies in fact have shown how the choice of boundary conditions has a significant influence on predicted flow patterns as well as on clinically relevant parameters, such as wall shear stress (WSS) [32,38,58]. This selection process often benefits from the availability of patient-specific in vivo measurements, so that BCs can be properly tuned to match available clinical data. These data might have been obtained with Phase Contrast Magnetic Resonance Imaging (PC-MRI), a technique for measuring blood velocity in specific sections of the vessel of interest, or with 4D-Flow MRI, a time-resolved PC-MRI with velocity encoding in all three spatial directions and 3D anatomic coverage [49]. For what concerns the inlet boundary condition, usually a velocity profile with a pulsatile waveform is prescribed. If patient-specific data are not available, physiological inlet flow waveforms are taken from the literature [36]. For what concerns outlet BCs, different strategies have been proposed, depending both on the complexity of the treated geometry and on the type of available clinical data. A common choice consists in using constant pressure or traction boundary conditions, even if this greatly affects accuracy [38]. A better solution resorts to the use of zero-dimensional (lumped parameter) models [44,43,52,17,19], which, by prescribing a specific pressure-flow relationship at each outlet, lead to more physiological pressure and flow waveforms, and to a better approximation of in-vivo data. Lumped models may consist of single resistances or more sophisticated zero-dimensional models, such as the three-element Windkessel model [61]. The use of such outlet boundary conditions, however, leaves the user with the problem of finding appropriate numerical values for the lumped elements. In this sense patient-specific in-vivo measurements, if available, can be used to guide the choice of the parameter values. The standard approach for cardiovascular CFD simulations consists in a first estimation of outlet resistive BCs through Murray's law [33], which gives an indication of how blood flow splits in vessel bifurcations. These initial estimates are then refined to match available patient-specific data through a manual tuning process, until the user-desired accuracy is obtained [5,31]. Despite being straightforward to implement, this approach is sub-optimal, operator-dependent, time-consuming, and affected by non-repeatability. To achieve robust and reliable patient-specific simulations, it is vital to rely on automated procedures for the selection of parameter values [6,48]. A first class of solutions is based on the use of a Kalman filter and its non-linear extensions, which performs the assimilation of measurements on the fly and updates the unknown parameters accordingly [27,7]. Arthurs et al. [4] proposed a reduced-order unscented Kalman filter for the sequential estimation of simple lumped parameter network parameters. Since the uncertainty estimation was limited to the unknown parameters, and not to the entire state space, the filtering operation was computationally tractable directly on 3D models. The data assimilation process, however, is still computationally expensive, as the estimation of n parameters requires running n+1 forward simulations.
A different approach for parameter estimation relies on Bayesian inference, where the unknown parameters are described as random variables, with the goal of yielding confidence regions instead of point estimates and quantifying the uncertainty affecting simulation results [56,45,13,37]. Schiavazzi et al. [45], for example, used Bayesian estimation for automated tuning of 0D lumped model parameters to match clinical data, estimating also the uncertainty induced by errors in the measurements. Tran et al. [56] proposed an iterative approach based on adaptive Markov chain Monte Carlo sampling to quantify confidence in local hemodynamic indicators, e.g., wall shear stress and oscillatory shear index (OSI).
Alternatively, variational approaches, such as optimal control, perform the parameter estimation by treating the governing equations as state system and the mismatch between the state solution and the patient-specific measurements as cost functional to be minimized [25,62,16,12]. In practice, the unknown boundary conditions are chosen as control variables to minimize the cost functional. As other advanced data assimilation methods, also optimal control suffers from a high computational cost, since it requires solving a constrained minimization problem. Nevertheless, recent studies have documented its successful application to several haemodynamics problems [40,10,34]. For what concerns the calibration of hard-to-quantify boundary conditions, Tiago et al. [54], for example, proposed a velocity control approach for the assimilation of velocity measurements in blood flow simulations. The framework was validated on an idealized 2D geometry and tested on a 3D model of a brain aneurysm, but with the assimilated velocity data still synthetically generated. In the work by Koltukluouglu et al. [25], a data assimilation method based on optimal boundary control for 3D steady-state blood flow simulations was presented. The methodology was validated against real 4D-flow MRI data measured on a glass replica of a human aorta. To reduce the computational cost of optimal control, Romarowski et al. [42] identified a surrogate optimization problem for prescribing PC-MRI data as outlet boundary conditions, tuning the parameters of a three-element Windkessel model via a least-squares approach. Zainib et al. [62] proposed a reduced order framework for the application of optimal control to coronary artery bypass grafts, where synthetically-generated measurements were used to tune Neumann-type outlet boundary conditions, thus bringing optimal control closer to a real clinical setting. Tiago et al. [53], moreover, used an optimal control approach to address the uncertainty coming from the segmentation process, which affects the definition of the geometry and, in turn, wall shear stress and its derived measures.
In this work, we propose an automated method for the selection of resistive-type outlet boundary conditions based on the solution of an optimal control problem, which assimilates a set of patientspecific measurements, e.g., through 4D-Flow MRI imaging. The assimilation is performed by constraining the minimization of the objective functional to the solution of a steady Stokes problem. Since Stokes equations correspond to the linearized steady-state Navier-Stokes equations, they are less computationally expensive, while still providing an adequate estimation of boundary conditions. The control variables are the unknown resistances imposed at the outlet through the coupled multidomain method introduced by Vignon-Clementel et al. [59]. To ensure a better match between simulation results and in-vivo data, the inlet flow waveform measured with 4D-Flow MRI is imposed as a patient-specific inlet boundary condition, as reported in Fig. 1. One of the novel aspects of this work is the use of more realistic boundary conditions with respect to Neumann and Dirichlet BCs, up to now the standard in an optimal control setting. Its suitability for real clinical scenarios is demonstrated in this work by validating the framework on four aortic arches, reconstructed from medical images of real clinical cases. The presented method is used in these cases to set the outlet BCs on the descending aorta and the supra-aortic branches, assimilating real 4D-Flow MRI data. The boundary conditions obtained with the proposed method are compared to those obtained with two alternative calibration techniques, namely, Murray's law and Ohm's law, demonstrating the ability of optimal control to assimilate known physiological data consistently better. Moreover, an analysis of time-averaged wall shear stress and oscillatory shear index values obtained using the three different calibration methods is used to assess their effect on clinical haemodynamic indicators.
This work is organized as follows: Section 2 presents the methodological details of the proposed optimal control approach. Results on four patient-specific anatomies are reported in Section 3, while Section 4 analyses the advantages and limitations of the proposed approach and Section 5 provides our conclusions and future perspectives.

Methodology
This section presents the methodological aspects of the proposed framework based on optimal control. Before solving the actual optimal control problem, some preliminary steps are required, namely, the extraction of patient-specific cardiovascular configurations from clinically acquired images, and the acquisition of patient-specific 4D-Flow MRI data. The proposed framework is represented in Fig. 2. 2.1. Data acquisition and anatomical reconstruction. The proposed methodology has been tested in four clinical cases from a single-center prospective study conducted at the Sunnybrook Health Sciences Centre in Toronto, Canada. The study was approved by the local ethics board and informed consent was obtained. Moreover, all the measurements were acquired non-invasively. Patients presented at the hospital for coronary bypass graft surgery. Between three and six weeks after surgery, a cardiac computer tomography (CT) was performed and anatomical information about their aorta and its supra-aortic branches was acquired using 320-detector row CT scanner (Aquilion One, Canon Medical Systems). From CT images, the vessels surface was reconstructed using the open-source package SimVascular [57]. The reconstructed volume was discretised into tetrahedral elements using TetGen [46]. After the CT scan, the blood velocity in the aorta and its branches was acquired in-vivo using a 4D-flow magnetic resonance imaging (MRI) sequence, using a 3T MRI scanner (MAGNETOM Prisma, Siemens Healthineers). The acquisition was performed using a 4D flow imaging sequence with retro-gating and adaptive navigator respiratory gating. Imaging parameters were as follows: velocity encoding=150 cm/s, field of view=200-420 mm x 248-368 mm, spatial resolution=1.9-3.5 x 2.0-3.2 x 1.8-3.5 mm 3 , temporal resolution=39.9-47.2 ms, flip angle=8 • . After 4D-Flow MRI, diastolic blood pressure P diast and systolic blood pressure P sys were measured with brachial cuff-based method. The mean arterial pressure P mean was computed as (1) P mean = P sys + 2P diast 3 .

2.2.
Determination of boundary conditions through optimal control. In general, an optimal control problem consists in determining a number of control variables, which are unknown quantities, so that a cost functional is minimized, under the constraint of a system of equations describing the physical state of blood flow. The solution of this problem provides both an estimate for the unknown control variables, and the solution of the state variables (pressure and velocity).
In the proposed framework, blood flow is modeled with the Stokes equations. This choice ensures a simpler optimal control problem with respect to its nonlinear version based on Navier-Stokes equations. Given the simplification that the Stokes equations introduce on the model, we will assess the effect on the quality of the determined output boundary conditions, by validating the obtained results on a Navier-Stokes model. This analysis is reported in Section 3.
Considering the large diameter of the aorta and supra-aortic branches, we can safely assume that the blood behaves as a Newtonian fluid and that the viscosity is constant, since the dimension of blood particles is smaller compared to vessel diameters. Therefore, we adopt the incompressible Stokes equations as state equations modeling blood flow in the computational domain Ω, which is the volume of the 3D aortic arch model reconstructed from medical images, as shown in Fig. 1. We refer to the boundaries of Ω as ∂Ω = Γ in ∪ Γ w ∪ Γ i , where Γ in , Γ w , and Γ i denote the inlet of the aorta, the vessel walls, and the outlets of the aortic arch, with 1 ≤ i ≤ i max (i max = 4 in the case of Fig. 1), respectively. The control variables are denoted as R i . Thus, state equations can be written in strong form as where v is blood velocity, p the pressure, ν = 0.04 dynes/cm 2 s the dynamic viscosity, and n the outward normal to the outlets. A plug profile is imposed at the inlet Γ in whose average value is extracted from the 4D-Flow MRI data. A no-slip condition is imposed at the vessel walls Γ w , assumed to be rigid and non-permeable, while at the outlets Γ i a resistive type boundary condition is imposed, following the coupled multidomain method proposed by Vignon-Clementel et al [59]. Since the optimal control framework for partial differential equations [21] is typically derived starting from the weak formulation of the state equations, we introduce Hilbert spaces V (Ω) and P (Ω) for the velocity v and the pressure p, respectively. In particular, we choose V (Ω) = H 1 (Ω; R 3 ) and P (Ω) = L 2 (Ω). Furthermore, we denote by U = R imax the space associated to the controls R = [R 1 , . . . , R imax ] T ∈ U . We note that V (Ω) and P (Ω) are function spaces (i.e., v(x) and p(x) are functions depending on the spatial coordinate x ∈ Ω), while U is simply an Euclidean space (i.e., R i are scalar numbers, and not functions).
Starting from the strong form in (2), the weak formulation is derived as: for every w ∈ V 0 (Ω) = {w ∈ V (Ω) :w| Γin = 0 andṽ| Γw = 0} and q ∈ P (Ω), where w and q are the test functions associated to velocity and pressure, respectively.
We now reformulate the term (3) 1 to obtain an equivalent weak formulation which is more suitable for the forthcoming finite element discretization. We introduce a set of Lagrange multipliers λ i , 1 ≤ i ≤ i max , defined as We further denote by λ = [λ 1 , . . . , λ imax ] T ∈ Z = R imax the vector collecting the Lagrange multipliers, and Z its associated space. Therefore, the equivalent weak formulation is: given Γi w·∇v ndΓ i = 0 in Ω, for every w ∈ V 0 (Ω), q ∈ P (Ω), η = [η 1 , . . . , η imax ] T ∈ Z, where η collects the test "functions" associated to the Lagrange multipliers λ. This is the final system representing how the control R affects the underlying physics of the model. In order to set up the optimal control problem, a proper cost functional must also be defined. We define the cost functional J with the following form The first term in (5) represents the normalized difference between the state pressure p and the patient's average pressure p d measured at a specific cross section Γ p ; as explained in 2.1, in this work p d was assumed equal to the mean arterial pressure, computed from the measured systolic and diastolic pressure. The second term, instead, represents the normalized difference between the calculated flow rate (obtained integrating velocity on the outlet section) and the flow rate Q i extracted from 4D-Flow MRI data at each outlet Γ i . The choice of minimizing the normalized difference between simulated and measured quantities ensures that each term gives the same contribution to the optimization process, even when assimilating measurements with different orders of magnitude. The weights α p and α i , however, can be used to change the contribution of each term individually. For the aortic arches under analysis, α p and all α i were set to 1, meaning that all measurements contribute equally to the minimization process. The optimal control problem then reads: To solve the optimal control problem, we adopt the adjoint-based Lagrangian approach [39,22,21,23]. This approach models the optimal control problem as an unconstrained minimization problem, whose solution corresponds to the minimum of a properly defined Lagrangian functional. In practice, the optimal solution is the one where all the derivatives of the Lagrangian functional vanish. The Lagrangian formulation requires the introduction of three new unknowns, the so-called adjoint variables, z ∈ V 0 (Ω), b ∈ P (Ω) and t = [t 1 , . . . , t imax ] T ∈ Z. The Lagrangian functional for this problem takes the form Given (6), the optimality system can be obtained by imposing that the derivatives of L with respect to (v, p, λ, R, z, b, t) must vanish, in short requiring ∇L = 0. Taking the derivative of (6) with respect to v (denoted by L v ) in the direction w we obtain while taking the derivative of (6) with respect to p in the direction q we get Similarly, the derivatives of (6) with respect to λ i , R i , z, b, t i are, respectively, The presence in Eq. (7a) of a term containing the product of two integrals requires the use of an additional Lagrange multiplier. We thus introduce the new variables k i = Γi v · ndΓ i , which we substitute in Eq. (7a), and we add the following equations to the system Equations (7a) through (8) form the so-called coupled optimality system, which we solve through a one-shot approach [21,50], where the system is solved directly for all the unknown variables.
We adopt an optimise-then-discretise approach, meaning that we introduce the numerical discretisation of the problem after the derivation of the optimality system. In particular, we rely on Galerkin finite element methods for the solution of the discrete version of the system. The domain Ω was discretised into a finite mesh of size h ∈ R, and so we introduce finite-dimensional solution spaces V h (Ω), P h (Ω), U h , Z h . In particular, we use Taylor-Hood elements for the velocity-pressure pair, i.e. P 2 finite elements to define V h (Ω) and P 1 finite elements for P h (Ω). Since the spaces associated to control and Lagrange multipliers are already finite-dimensional, we set U h = U and Z h = Z. The discretised system is solved using the open-source libraries FEniCS [2,29] and multiphenics [1], the latter being an open-source library developed at SISSA mathLab for easy prototyping of problems characterized by a block structure and boundary restricted variables. The numerical solution of the problem is obtained by means of MUMPS [3], a parallel sparse direct solver.

Synthetic data.
A mesh convergence analysis was first conducted on the patient-specific meshes used for the experiments. In Figure 3 the average TAWSS and OSI are plotted with respect to the number of elements in the mesh. The mesh used in the following experiments has about 2.5×10 6 elements, which has reached convergence for OSI, but not yet for WSS. This choice, however, is the best compromise in terms of accuracy and computational cost of the simulations.
The validity of the proposed approach was first tested on a test case (corresponding to the patient anatomy that will be labeled as "case 1" in the following) with synthetically generated data. To obtain the ground truth data, case 1 was simulated in SimVascular, imposing a velocity waveform at the inlet with average flow rate Q = 119.1 cm 3 /s, using a blunt profile. At the outlets, threeelements Windkessel models were imposed. A physiological value of the total resistance at each outlet was arbitrarily chosen, and each resistance was then split into a proximal one, R p,i = 0.09R i , and a distal one, R d,i = 0.91R i , as suggested by Kim et al [24]. For the capacitance, a total value of 0.001 cm 5 /dyn was assumed [28], which was then split among the four outlets proportionally to their area. The distal pressure was set to 0 at all outlets. To reach periodic convergence, the simulation was run for five cardiac cycles, and the average flow rate at the four outlets and the average pressure were extracted from the last cardiac cycle. These data were fed into the optimal control tool presented in Section 2 to estimate the total outlet resistances. The estimated parameters were then used to set the outlet boundary conditions of a second simulation, again in Simvascular. Both resistances and capacitances were split adopting the same rules of the forward simulation. Table 1 reports a comparison between original and estimated resistance values, together with original and estimated average flow rates at the outlets. Flow and pressure waveforms at the outlets are compared in Fig. 4, which shows how the resistances chosen with optimal control allow to reconstruct the original flow waveform with a relative error of 0.09% for BCA, 0.09% for LCC, 0.1% for LSUB and 0.02% for DAo. The pressure waveform is recovered with a relative error of 0.005%.

3.2.
Patient-specific data. Moving to the real cases with patient-specific data, the outlet boundary conditions estimated with the proposed optimal control framework were compared to those obtained with two alternative common techniques based on Murray's law and Ohm's law.    Murray's law. Murray's law [33], formulated by Cecil D. Murray in 1926, governs the branching pattern of vessels, such that the flow in each outlet is proportional to its cross-sectional area. In particular, the general form of Murray's law reads where Q i is the flow rate at the outlet, r i is the radius at the outlet, and n for the aortic arch is conventionally set to 2. Multiplying r i by π to express the relationship in terms of outlet areas, and using R ∝ 1 Q , one can estimate the outlet resistances for the aorta and its main branches as where j |Γ j | is the sum of the area of all the aortic outlets, while |Γ i | is the area of the outlet to which resistance R i is associated. The total resistance R tot was computed as the mean pressure p d measured non-invasively on the patient, as reported in Section 2.1, divided by the mean aortic flow rate Q 0 measured with 4D-Flow MRI, and then split among the outlet branches according to Equation (10). The application of Murray's law for predicting flow splitting has been largely investigated both on human and animal subjects by a number of studies [20,55,8,41], which evidenced its validity on a large portion of the cardiovascular system, even if with some limitations on the first branches of the aortic arch [63]. Note that, except for the average pressure and inlet flow rate, Murray's law does not take into consideration patient-specific measurements to compute flow splitting: instead, assuming that branches with larger cross-section have higher flow rates, it is solely based on the patient's anatomy. This feature justifies its use in those studies where in-vivo measurements of flow rates are not available [47,60,15]. Ohm's law. Based on the Ohm's law, it is possible to set outlet resistances by taking advantage of the analogy between the cardiovascular system and electrical circuits. In particular, knowing the mean pressure p d computed from diastolic and systolic pressure measured non-invasively and the This method is also common [38] and it is based on the idea of performing the parameter estimation on 0D models [35] but, differently from Murray's law, it requires the availability of outlet flow rates measured in-vivo. The measured flow rates usually respect the mass conservation principle with approximately a 15% deviation [11], due to measurement uncertainty. For this reason, we developed a minimization problem which, using Ohm's law, estimates outlet resistances R i while trying to impose the mass conservation principle. In this way, we try to compensate for the intrinsic inconsistency in the data, which is not accounted for in Ohm's law of Eq. (11). This is achieved by approximating the aorta with its equivalent 0D model, which is represented in Fig. 5a, and minimizing the cost function The cost function was minimized using the Matlab function fminsearch, which employs a derivativefree simplex search method [26]. The cost functional reported in Equation (12) deliberately replicates the one used inside the optimal control framework, reported in Equation (5), with the first term representing the normalized difference between the computed pressure and the measured one Figure 5. Adopted equivalent circuits. On the left, equivalent circuit used for Ohm's law method. On the right, 3-element Windkessel model used as outlet boundary condition for unsteady Navier-Stokes simulations. (p d ), and the second the outlet flow rates Q i . However, optimal control relies on Stokes equations as a 3D-model of the underlying system, whereas here a 0D approximation is used. The experiments described in this section were conducted on four patient anatomies, obtained as described in Section 2.1. Table 2 reports for each case the measured flow rates. Specifically, the column labeled Net flow indicates the difference between measured inlet flow and outlet flows, thus quantifies the violation of mass conservation on the measurements. The inlet flow reported in Table 2 was obtained by subtracting 4% to the flow measured in the ascending aorta, which corresponds to the total coronary circulation [14], not considered in the models. The presence of flow rate inconsistencies in 4D-Flow MRI data could be due to the finite resolution of 4D-flow MRI, motion artifacts, and the presence of noise, especially in presence of complex helical and vortical flows [9]. The amount of net flow is below 15% for all the cases under analysis, which is considered acceptable for 4D-Flow MRI measurements according to Dyverfeldt et al [11]. While in case 1 and case 4 the net flow is significant, for cases 2 and 3 it is practically negligible. Table 3 where, for each case, the first row reports the patient's average pressure, measured noninvasively after MRI, and the flow rates measured in-vivo with 4D-Flow MRI at the four outlets: BCA, LCC, LSUB and DAo. The values obtained solving Stokes equations on the 3D geometry, with resistance values calculated by means of Ohm's law (Eq. (11)) are reported in the second row, while the third row contains the results obtained with the optimization based on Ohm's law as in Eq. (12). The fourth contains the results for Murray's Law. Finally, the fifth row shows the results of the proposed methodology based on optimal control. In all simulations, the inlet flow was imposed using a plug profile. For case 2 and case 3, where the net flow is negligible, both Ohm's law and optimal control properly assimilate the available data, with a relative error of less than 1% on all the outlet flow rates. For case 1 and case 4, where the net flow is high, optimal control outperforms the other techniques, achieving the smallest relative errors on pressure and BCA, LCC, LSUB flow rates. In presence of a large net flow, we cannot expect a perfect assimilation of measurements, as they are intrinsically non-physical. In that case, optimal control shows a smaller sensitivity to inconsistencies in the data, leading to a physical solution which is closer to measurements with respect to the other techniques. As expected, the optimization based on Ohm's law is more accurate than Ohm's law for case 1 and 4, while the two methods are basically equivalent for case 2 and 3. As already pointed out earlier, as Murray's law is the only technique which does not take into account the measured flow rates to set outlet boundary conditions, the corresponding solution is the one that most deviates from patient measurements. The solution of the optimal control problem required an average of 6.75 minutes (wall clock CPU time), running on 18 Lenovo SD530 nodes, each with 40 Intel "Skylake" cores and 202 GB RAM.  Table 2. Table summarizing, for each case, the measured inlet flow rate, the sum of the measured outlet flow rates, the difference between the two (Net flow), and the percentage of mass conservation violation.

Boundary conditions estimation for inaccurate measurements.
In presence of a large net flow, the presented approach compensates for the inaccuracy in the data by adjusting the outlet boundary conditions. This means that the inconsistencies in the measurements are resolved entirely at the outlets, while the measurement imposed at the inlet is considered deterministic. It would be desirable, instead, to gain some flexibility in the assimilation of the inlet flow, which is equally affected by uncertainty. In this case, a modification of the approach presented in Section 2 is possible, which estimates both the inlet and outlet BCs by means of an additional control at the inlet Dirichlet boundary condition. In particular, the velocity at the inlet in 2 is expressed as where u in is a scalar control variable and v in is the inlet velocity profile, with average value equal to the one measured with 4D-Flow MRI. By choosing the best value for u in , the optimal control problem will be able to change the inlet flow rate to better assimilate the available data.   This obviously requires a slight modification of the cost functional, with an additional term for assimilating the flow rate Q in at the inlet Γ in : Moreover, the Dirichlet control requires weakly imposing the inlet condition by means of Lagrange multiplier, thus increasing the final size of the system of equations (7a) - (8). In table 5 we report the results with this alternative formulation for cases 1 and 4, which had the largest Net flow. As expected, the net flow is now resolved acting on all boundary conditions, leading to lower differences between measured and simulated flow rates. It is worth mentioning that the additional control leads to an increase in the dimensions of the problem, and consequently to larger computational costs (an average of 10 minutes of wall clock CPU time, running on 24 Lenovo SD530 nodes, each with 40 Intel "Skylake" cores and 202 GB RAM).  Table 5. Comparison of measurements and pressure and flow rates for Stokes simulations obtained with the extended optimal control formulation, which controls both the inlet and the outlets boundary conditions. 3.5. Unsteady Navier-Stokes simulations. An accurate representation of blood flow in the aorta is generally obtained through unsteady Navier-Stokes simulations, which provide a more realistic and accurate time evolution of blood flow. Assuming laminar regime, the incompressible Navier-Stokes equations take the form in Ω. (15) We used the resistance values R i reported in Table 4 as outlet boundary conditions of highfidelity unsteady Navier-Stokes simulations performed using SimVascular [57]. The purpose of this analysis is twofold. First, it verifies that the flow splitting obtained with a steady linear Stokes model is still valid in a non-linear, unsteady scenario. Second, it allows to analyse the impact that boundary conditions obtained with different estimation techniques have on wall shear stressrelated indicators, which are clinically relevant. For unsteady Navier-Stokes simulation, the type of outlet boundary condition which best replicates realistic flow conditions is the three-element Windkessel model [38] represented in Fig. 5b. Referring to Fig. 5b, each resistance R i was split into a proximal one, R p,i = 0.09R i , and a distal one, R d,i = 0.91R i , as suggested by Kim et al [24]. For the capacitance, a total value of 0.001 cm 5 /dyn was assumed [28], which was then split among the four outlets proportionally to their area. The distal pressure was set to 0 at all outlets. The dynamic viscosity was set to ν = 0.04 dynes/cm 2 s, a rigid wall model was assumed and a plug profile was imposed at the inlet. The inlet waveform was the one extracted from 4D flow MRI. The time-step value for the transient simulations was set to 0.5 ms, and 5 cardiac cycles were simulated. The results reported here refer to the last cardiac cycle. Each simulation required an average of 8 hours (clock wall CPU time), running on 4 Lenovo SD530 nodes, each with 40 Intel "Skylake" cores and 202 GB RAM. Figure 6 reports the velocity streamlines and pressure distribution for case 3 at three different time instants along the cardiac cycle. A comparison of pressure and outlet flow rates obtained with Navier-Stokes simulations using outlet boundary conditions estimated with the three different techniques introduced previously is reported in Fig. 7. The histograms represent, for each outlet, the relative difference of the average flow rate with respect to the measured one using Murray's law, Ohm's law, or the proposed method. Also for this simulations, the inlet flow was imposed using a plug profile. As expected, the errors of the obtained flows with respect to the measured ones increased when moving from a Stokes model to a Navier-Stokes one, mostly due to the nonlinearity and time-dependency introduced by the latter. Nevertheless, similar trends to those of the Stokes experiments reported in Table 3 can be observed when moving to Navier-Stokes simulations. In particular, Murray's law remains the method providing the largest deviations from measured flow rates, while both Ohm's law and optimal control are closer to assimilated data. With the exception of case 3, optimal control is still the method which best replicates measured flow rates. These results show that the BCs estimated with a linear, steady Stokes model proved to be a good choice when moving to high-fidelity Navier-Stokes simulations, thus supporting the approach of estimating BCs on a linearised Stokes model. Additionally, Figure 8 reports a comparison of time-dependent flow rates extracted from 4D-Flow MRI and those obtained from time-dependent simulations with boundary conditions estimated with optimal control. Even if the proposed estimation method assimilates only the average flow rates, the time-dependent waveforms are still recovered with a good degree of accuracy. For the sake of space, only results for case 4 are reported, with comparable results for the other cases.
To assess the influence that the adopted BCs estimation technique may have on clinically relevant parameters, we carried out an additional analysis on two relevant haemodynamic indicators, namely, the time-averaged wall shear stress (TAWSS) and the oscillatory shear index (OSI), calculated from Navier-Stokes simulation results using the equations reported by Martin et al. [30].  For the sake of space, we report the analysis for case 3, but similar results were obtained for the other cases. Fig. 9 shows, in the left column, the TAWSS obtained for the two cases with three different techniques (optimal control, Murray's law, and optimization based on Ohm's law), and in the right column the local relative difference with respect to optimal control results. The same analysis was repeated for the OSI in Fig. 10. For each point of the surface anatomy, the local relative difference was computed as: For case 3, the difference in the TAWSS reaches a maximum relative difference of 24.8%, while the discrepancy in the OSI value reaches 55%. The largest differences occur in the Murray's law case, in correspondence of LSUB, which is also where the estimated resistance values differ the most (46%). It is worth noticing that, outside some specific 'hot-spots', the relative error is generally lower, around 10%. This analysis reveals the impact that the values of resistive boundary conditions have on haemodynamic indicators. In particular, given the relevance of TAWSS and OSI in a clinical context, the adoption of different techniques for BCs estimation could possibly affect the observations done by medical doctors, reaffirming the importance of adopting an automated, reliable, and operator-independent technique for boundary condition estimation.

Discussion and Limitations
The proposed approach for boundary condition estimation presents some considerable advantages. First, optimal control relies on a rigorous and general mathematical framework, which ensures the possibility to apply it to different vessels in the cardiovascular system, provided that in-vivo measurements are available. Second, the mathematical structure of optimal control leaves great flexibility in terms of the nature and quantity of measurements to assimilate, an appealing feature for cardiovascular applications, where in-vivo measurements can be either pressure or flow waveforms. In particular, the proposed method does not specifically require data from 4D-Flow MRI, but it is compatible with any method providing flow rate information at the inlets and outlets of the region of interest, including the more common PC-MRI modality. Moreover, the proposed formulation assimilates data in a least-squares sense [21], reducing the influence of stochastic measurement uncertainty on the solution.
On the other hand, the proposed technique presents some limitations. The main limitation comes from the use of steady-state, linearized Navier-Stokes equations inside the optimal control problem. As explained in the Introduction, optimal control problems are characterized by a high computational cost. For this reason, the solution of a time-dependent optimal control problem is at the moment computationally intractable. The necessity to use a steady-state formulation of the problem requires resorting to the Stokes model, as Navier-Stokes equations may not converge to a steady-state solution for a complex flow like the one in the aortic arch. On one side, using a simplified model like the Stokes one significantly reduces the computational cost for the data assimilation process. On the other side, steady Stokes equations are clearly inadequate to get a realistic representation of the flow in the aorta. For this reason, the solution of the optimal control problem is used solely to estimate the outlet resistances, while for realistic pressure and velocity distributions a subsequent time-dependent simulation is still necessary. One main consequence of using a steady-state formulation is the possibility to estimate only the total value of the resistance. Estimating the outlet capacitance, in fact, would require solving a time-dependent Navier-Stokes problem. For the same reason, it is not possible to determine multiple resistance values at each outlet when using more advanced outlet boundary conditions, such as the proximal and distal resistances in a 3-element Windkessel model, being then forced to adopt capacitance values and rules for resistance splitting taken from literature. Lastly, the proposed method can only assimilate average flow rates, and not time-dependent flow waveforms. The results presented in Section 3, in particular the simulated waveforms reported in Figure 8, prove that, when the resistance and capacitance values determined with the proposed method are used in an unsteady simulation, the obtained pressure and flow rates values are in sufficient agreement with the in-vivo measurements used for BC estimation.

Summary and Conclusion
In this work, we proposed a framework based on optimal control for the automated estimation of unknown resistance-type boundary conditions, while assimilating in-vivo pressure and flow rate measurements. The experiments conducted on four patient anatomies revealed the validity of the proposed optimal control-based technique for assimilating 4D-MRI data. Specifically, when compared to two other common techniques, namely, Murray's law and Ohm's law, the proposed framework performed consistently better. An additional investigation of the effects of the different estimation methods on wall shear stress-related parameters exposed the influence that boundary conditions play on clinically relevant quantities. This further confirms the need for an automated method, such as the one proposed, which eliminates the expensive manual tuning phase, together with intra-and inter-operator variability. The proposed method, therefore, represents a first step in incorporating optimal control, thus a reliable, automated, and robust optimization technique into a framework which can be exploited by the medical community in a clinical setting. The field is promising and opens important perspectives for mathematical modelling and numerical simulation in cardiovascular flows.
A first extension of the present work is the application to other clinically relevant scenarios, such as coronary artery bypass grafts, where the scarcity and noise of available data limit the applicability of other estimation techniques. Furthermore, the current framework estimates only resistive-type quantities, while the capacitance values are still chosen based on generic information available in the literature, usually combined with a manual tuning process. Future works will be directed toward the automated tuning of capacitance values as well.