1 Introduction

Swimming is a complex interaction of the swimmer with the surrounding fluid. The evolution, a natural optimization process evolving millions of years, has led to a high variety of shapes, motion pattern and locomotion techniques in the aquatic fauna, such as employed by jelly fish, sea mammals or fish, which commonly make use of their entire body for locomotion. High performing fish employ in particular their caudal fin (Sfakiotakis et al. 1999) and reach impressive thrust and body acceleration.

Fish robots with bioinspired and biomimicking locomotion strategies aim to reproduce the highly optimized motion pattern of real fish. However, they are commonly quite constrained in their motion and achieve only low complexity compared to their natural role models. Despite the efforts of generations of engineers in the last decades, the impressive swimming performances of tunas or trouts still seem unattainable for a robot. Common fish robot designs are based on a low number of actuators compared to the complex variety of muscle groups of a real fish. Most make use of a single actuator, such as the systems presented by Tan et al. (2021); Chen et al. (2018); Liu and Hammond (2020). Regarding the challenges and limitations from artificial systems it becomes obvious, that a locomotion pattern of a bio-mimicking robot will significantly differ to a real fish.

Nevertheless some fish robots are very performing in swimming speeds: Tong et al. (2022) designed a high-performance robotic tuna with the length of 720 mm. It reached a swimming speed of 3.13 body lengths per second (BL/s), the common measure for the swimming performance of fish and fish robots. They improved swimming performance with an optimization of the tail fin structure and the dynamic parameters of swimming, such as amplitudes and frequencies. This robot shows a great motion performance, but it is still not comparable to real fish. Zhong et al. (2017) presented a high performing 310 mm long wire-driven robot fish with maximum speed is 2.15 BL/s and great maneuverability of 63\(^{\circ }\)/s. The high performance swimmer Isplash II from Clapham and Hu (2014) was able to reach impressing 11 BL/s. This is even faster than some real fish. However, the speed optimized robot was not able to navigate.

The swimming kinematics of real fish are based on their fluid–body interactions. The streamlined bodies of BCF swimmers are slender and flexible. The body parts vary in stiffness, some are actively moved, some are passive. Parts of body and fins commonly encounter large, passive deformations. This impacts the flow in a feedback loop while the deformations are a result of the hydrodynamic loads. These adaptive characteristics allow for flow control with a significant reduction of the drag and an efficiency gain (Fish et al. 2008). This effect can be used as a mechanism in technical applications, as shown in studies on flexible hydrofoils by Hoerner et al. (2021) or turbines by Descoteaux and Olivier (2021). However, from a mechanical point of view they make fish locomotion a very complex case in fluid mechanics.

Fig. 1
figure 1

Optimization strategies for complex multiphysics. Comparison of uncertainty as function of cost for analytical model-based optimization (AM-O), experimental optimization (Exp-O) and CFD-based optimization (CFD-O)

Smits (2019) analyzed the flow kinematics of fish emphasizing on the caudal fin with use of a simplified physical model of a pitching and heaving hydrofoil. He found the lateral tail fin velocity perpendicular to the swimming direction to be key for the thrust generation as it governs added mass effects from the water displacement as well as lift forces from pressure differences.

However, it has to be noted that drag forces and actuation frequency will depend on the axial velocity in the swimming direction. This is due to two dimensionless numbers which characterize the flow: the Reynolds number and the Strouhal number (Senturk and Smits 2018), the first is a measure of the flow turbulence, which greatly impacts the drag the second a measure for the relation of the time scales of motion (vortex generation) to the flow (vortex convection).

In consequence, even though efficiency changes, the swimming modes should remain very similar regardless of the swimming speed. This implies that the flow velocity is negligible to determine well performing motion pattern or gaits for fish mimicking robots. Which is important for this study as it allows for an investigation of the motion pattern on a tethered fish robot in still water without major impacts on the transferability on the results. However, the actuation frequency and the actual swimming efficiency should change. The first two parts of the hypothesis of Smits 2019, modes and frequency are covered by the findings of Di Santo et al. (2021). They found no changes in the swimming modes but a raising stroke frequency for raising swimming speeds by analyzing video footage of cruising body and caudal fin (BCF) swimmers.

Analytical models for such complex physical processes are usually subject to strong simplifications, such as the absence of any viscous effects. As a result, they only allow an estimate of the real physics, are subject to considerable uncertainty and can only be used for a qualitative model. This is a serious drawback for determining an optimized motion pattern for a bio-mimicking robotic fish. Accurate flow physics, fluid–structure interactions (FSI) and design and propulsion constraints must also be considered in the search for the best solution. This makes the task a major challenge. The key to a reliable optimization process is to find a good compromise between accuracy and cost when evaluating the possible motion patterns.

Figure 1 provides an overview of several approaches to optimize complex multiphysical cases (in particular when involving fluid–structure interactions and mechatronics). All approaches feature advantages and drawbacks: as aforementioned analytical methods based optimization (AM-O) is commonly very inexpensiv regarding the computational costs but inherits a strong uncertainty due to modeling errors. As an example, Zhong et al. (2018) developed an analytical model of their robot using a combination of the Kirchoff and the Morison equations and experimentally determined some fitting coefficients prior to the calculations for the design process. They reported an over prediction of roughly 80% of the thrust on a fish robot in their model compared to the subsequent experiment. Despite a significant overestimation of the thrust force compared to later experiments, they were able to successfully develop the robotic design and to determine the best control law for the swimming mode from a set of possible approaches. It has to be noted that AM-O can clearly provide a very good trade-off in between accuracy and costs.

For applications involving flow problems an optimization using computational fluid mechanics (CFD-O) commonly provides better accuracy in the evaluation, in particular using unsteady 3D simulations. Complex cases, such as the industrial heat exchanger which combines mass with heat transfer shown by Janiga and Thévenin (2008) or Daróczy et al. (2014), require CFD-O. AM-O will not be applicable anymore without high uncertainties of the results. As aforementioned the computational costs are high, to provide an idea of the efforts: Cleynen et al. (2021) evaluated almost 2000 individual CFD cases to determine the optimal shape of a water wheel using only four independent parameters in their design space in 432 000 CPU-hours within three months. They employed simplified 2D unsteady Reynolds averaged Navier Stokes (URANS) simulations which fully model turbulent effects and only calculate low-pass filtered (major) changes in the flow field to reduce the computational costs. This is problematic as fluid flows are obviously always 3D and turbulence is a key parameter for the flow regime of a full scaled turbine. The resulting lack of accuracy and gain in uncertainty for the simulations was mitigated by subsequent 3D simulations for examination of the performance for the best configurations. It showed significant differences in the predicted performance, which was higher than the gain from the optimization itself compared to neighboring regions in the Pareto front. However, the authors consider this point as unattractive rather than dramatic, since optimization is only about examining relative differences in between the results and not depending on an systematic absolute error. Regarding CFD-O in particular unsteady 3D simulations can be considered unfeasible for an optimization.

Multiphysical simulations additionally require to account for coupled effects such as a FSI or mechatronical effects, the uncertainty and in particular the costs raise by several magnitudes. The more complex the case and the bigger the design space, the better suitable are experimental-based optimization strategies (Exp-O) as they commonly require an extensive primary investment (automation costs of the experiment) but feature high accuracy and low evaluation costs for each individual in a generation of the optimization.

To summarize: Analytical model based optimization (AM-O) is numerically inexpensive but bears high uncertainty. Experimental optimization (Exp-O) has high initial investments but high accuracy and low individual evaluation costs. CFD-based optimization (CFD-O) shows high numerical costs and higher uncertainty than most experiments, while multiphysical simulation based optimization (MPS-O), such as FSI coupled with mechatronics, is numerically hardly affordable. Therefore, the choice of the best method is depending on the case at hand.

In the following the swimming modes for a bio-mimicking fish robot are studied. The aim is to maximize the body propulsion with lowest swimming efforts. These competing goals lead into a multi-objective optimization problem involving complex fluid–structure interactions with large body deformations. Therefore it serves as a perfect application case for an EXP-O.

Additionally, in the case of the robot, it seems reasonable to use machine learning coupled with an experiment for the determination of the best swimming modes. This will make the fish robot to learn by itself how to swim. However, the biggest advantage using this method is that it allows for an accounting for its own abilities and disabilities (constrains), such as nonlinear characteristics of the actuation.

Zhang et al. optimized the swimming performance and power consumption of an eel-like robot using NSGA-II algorithm due to its fast convergence to the Pareto front for complex models (Zhang et al. 2019). Due to the aforementioned reasons and good experience made in previous work of the authors (Abdelghafar et al. 2023), the NSGA-II was employed in this study as well. The use of an experimental approach bears multiple advantages: (1) the optimization procedure accounts for the real physics involved, even for unforeseen constraints or limitations will be accounted. (2) In theory, there are no simplifications required at all, and (3) a parameter set from the design space is evaluated within seconds or minutes.

The entire optimization process can be performed within a day on a laboratory flume (Abbaszadeh et al. 2019) instead of months of computations on high performance computers (HPCs) (Cleynen et al. 2021). However, the application of Exp-O is not limited to robots. Strom et al. (2016) successfully optimized the intracycle velocity trajectory of a tidal turbine using a Nelder–Mead method (Nelder and Mead 1965). They found an efficiency gain of almost 80%. For technically more complex cases which cannot easily be evaluated directly with a 1:1 prototype or a physical model, similarity laws from fluid mechanics can be used to build surrogate models. In a previous study, we have used an experimental surrogate model to determine the optimal intracycle pitch trajectory for a tidal turbine using a full factorial approach on an oscillating hydrofoil. The fully automatized setup was controlled by a set of three parameters using a spline interpolation of the trajectory (Abbaszadeh et al. 2019). A similar approach has later been used by Busch et al. (2022). They extended the method using genetic algorithms (GAs) for an improved optimization convergence and also investigated other models to reduce the control parameters such as proper orthogonal decomposition (POD) and finite Fourier series to describe the trajectories. Another recent optimization study using a comparable optimization methodology has been shown by Fasse et al. (2023) on a blade-actuated cross flow ship propeller. The initial idea introduced in 2019 has also been developed further and brought to a higher level of maturity by the authors. In the case at hand our laboratory’s custom optimizing software is coupled with an experiment of a robotic fish. As already done by Busch et al. 2022, we use GA that speed up the optimization process, which is necessary in order to investigate a more a complex case with many parameters in the design space. The meta heuristic characteristics of GA allow for an optimization of complex problems without precise knowledge of the task itself, which is treated as a black-box system. Therefore, GA are an interesting choice if a broad variety of tasks should be addressed with the same strategy. However, their great applicability comes with the price of uncertainty regarding the accuracy of the final optimum, which is not guaranteed by these methods.

Experiments allow for an exploration of a huge design space. An evaluation is possible within a short time scale once the experiment is setup. Our aim is that the application of the method presented here will not be limited to the determination of an optimal control trajectory or strategy, which is the most obvious application. As an example, we propose the use of Exp-O for classical shape optimization of complex machinery using automatized morphing techniques with actuated mechatronical devices.

Here, we show and describe an appropriate experimental framework for the use of these machine learning techniques with the aim of the optimization of complex multiphysical systems.

Using the robotic fish as an application case, we also show how such an experimental optimization can provide further insights in the complex interactions of the variables of the design space. More precisely we will contribute to the following questions:

  • How does an optimization framework for complex multiphysics using genetic algorithms coupled with an automatized experiment look like?

  • What are successful swimming modes for a small bio-mimicking fish robot in order to reach highest propulsion forces combined with lowest energy consumption?

  • What are key parameters for such an efficient and powerful locomotion law and how do they depend on each other?

  • Is it possible to reduce the complexity of such a motion law significantly with only small performance losses in order to design powerful robots with low complexity?

The article evolves as follows: In the next section the robot, its hardware and governing system, the experimental setup and the required software framework for the optimization is introduced and described. Subsequently, the Pareto fronts, results of the optimization (in both still and running water are presented and analyzed. This analyze delivers insights in the influence of each of the controlled variables and their interdependence in the design space based on five parameters for controlling the robot’s motion pattern. Finally, generalized design recommendations for similar fish robots are derived.

2 Experimental methods

2.1 Robotic fish and general objectives of the example optimization

Background for the development of the subsequently described robotic fish is the aim to replace live-animal tests for the assessment of the injury risk in hydropower facilities. A semi-autonomous propelled probe equipped with pressure and acceleration sensors (IMUs) shall replace the live fish in long term and is hypothesized to provide better results than passive drifting probes, the current state of the art (Pauwels et al. 2020). For this reason, the robot has to be soft, small, lightweight and it has to perform rheotaxis, the counter flow positioning of the body in the flow. This becomes necessary because the positioning has been found to be key for fish injury risk in turbine passages in several studies, such as by Geiger and Stoltz (2022) or van Esch and Spierts (2014). Additionally, the device must feature positive buoyancy in order to be found and recollected in the tail water after the turbine passage while floating on the surface. For an appropriate assessment of possible blade strikes, the body should have similar stiffness and bending characteristics to those of real fish and has to provide enough strength and durability to survive the extreme conditions in the turbine runner such as grinding on walls, rapid pressure changes or blade strikes.

2.2 Design of the fish robot

Fig. 2
figure 2

Design of the tethered robotic fish, support and measurement equipment Abbaszadeh et al. (2023)

A 367 mm long brown trout shaped body of the robot has been designed in accordance with consulting biologists. The selection of suitable actuators based on a review of bioinspired robotic locomotion systems has been shown in Abbaszadeh et al. (2021). Finally piezoelectric ceramic actuators, so-called macro fiber composite (MFC), have been selected. They were considered to be the best option in a trade-off of all requirements of the project, because they offer an acceptable weight-to-length ratio, an advantageous shape for the soft and flexible body design and the highest swimming performance relative to the weight of the drive train. The design of the robotic fish follows these MFC actuators and is depicted in Fig. 2. While the head is a rigid 3D printed part from resin, the body is constructed as a compound of several material layers. The skeleton in the middle is built from a 0.2 mm fiber reinforced composite (FRC) plate. In total four piezo-based actuators, in an arrangement of two couples of different size and performance have been bonded at both side of the skeleton. Each couple of single-layer MFC build a bimorph actuator, working as one artificial muscle. This active part of the body is followed by a 70 mm passive caudal fin which also consists of FRC. The two independent bimorphs allow for an individual set of the control signals for each of the artificial muscles using different amplitudes \(A_{1,2}\) and stroke frequencies \(f_{1,2}\), as well as a phase shift \(\phi\) in between front and rear actuator. The result is a locomotion pattern which can be controlled with five parameters.

The compound structure is subsequently coated with different silicones and polyurethanes for water tightness and electric isolation. A finite element analyze (FEA) of the structure has shown that neither the bonding material nor the coating has a significant role to the kinematics and can be neglected as shown by Weber et al. (2021). In a later state of the project, the electronics will be placed in the anterior rigid part of the device. In the current setup, the robot is tethered at 0.36 of the BL and receives the control signals via wires from external control and feeding sources (see Fig. 3 for the control and instrumentation setup).

Fig. 3
figure 3

Experimental optimization setup: The Optimizer is running on a PC and communicates with the MCU. The MCU controls the actuators and captures the measured variables (\(\epsilon _1,\ \epsilon _2,\ F_{hyd} ,\ i_{act} , \alpha\)). These are processed on the PC and then fed back to the optimizer

2.3 Actuation and control system

The four actuators of the artificial muscles can be driven individually with a set of two high voltage power amplifiers (microHVA-2) purchased from the vendor of the actuators. This power amplifier has one fixed 500 V output, and two variable outputs from 0 V to 2 kV. The sinusoidal wave from the variable output is overlaid by an bias of +500 V. This allows for a simultaneously driving of two MFCs in the bimorph constellation with a voltage range of −500 V to +1500 V. The power amplifier is steered through pulse-width modulated (PWM) signals provided by the microcontroller unit (MCU). The normalized actuation variables of the artificial muscles are defined by Eqs.  (1) and (2).

$$\begin{aligned} X_{1}&= A_{1}\cdot \sin (2\pi f_{1}\cdot t) \end{aligned}$$
(1)
$$\begin{aligned} X_{2}&= A_{2}\cdot \sin (2\pi f_{2}\cdot t+\phi ) \end{aligned}$$
(2)

2.4 Sensing system

Figures 2 and 3 show the hardware and control setup employed. The robot is tethered with a streamlined support. It has one degree-of-freedom, a rotation in the x-y plane (yawing) with use of a rotating 1D sensor beam to capture the hydrodynamic force \(F_{hyd}\) acting in the swimming direction of the fish. The sensor is hold by two glass/polymer ball bearings. The measurement uncertainty of ±20 mN has been determined with the 10 N load cell Sauter FC 10 as reference. The sensitivity of the force sensor is defined by the output of 0.8 mV/V for the full scale of 7.65 N and an excitation voltage of 5 V. It is connected to an analogue-to-digital converter of the MCU through a custom amplifier with a gain of 1000, providing a good signal-to-noise ratio (sensor accuracy: ±0.65% Full Scale, linearity: \(R^2>0.996\) in the operating range).

An encoder coupled on the rotating axis allows for determination of the head angle \(\alpha\). It is able to capture instantaneous magnitude of \(\alpha\) with a sample rate of 200 Hz synchronized to \(F_{hyd}\) (in time) with an accuracy of less than 0.5\(^{\circ }\) within the operating range. It is used to calculate the thrust component from the hydrodynamic force as:

$$\begin{aligned} F_{swim} = F_{hyd} \cos ({\alpha }) \end{aligned}$$
(3)

The head pivot point is located at a distance of 131.5 mm from the nose, equivalent to 0.36 BL. Strain gauges placed on the actuators as full bridges and a kinematic model provide the position feedback of the actuated spine of the robot. The kinematic model (see Eqs. (49)) has been explained in detail in Abbaszadeh et al. (2021). The \(x-y\) position can be summarized as function of length l and thickness of each section b as well as the strains \(\epsilon _{1,2}\), which are measured by two strain gauges. The set of equations is shortly summarized here for the sake of completeness (see Fig. 4 for geometry and dimensions):

$$\begin{aligned} \begin{bmatrix} x\\ y \end{bmatrix}&= \begin{bmatrix} f_{x}(l, \epsilon _{1}, \epsilon _{2}) \\ f_{y}(l, \epsilon _{1}, \epsilon _{2}) \end{bmatrix}\nonumber \\&for\, 0<l<L\, (bimorph~I): \end{aligned}$$
(4)
$$\begin{aligned} \begin{bmatrix} x \\ y \end{bmatrix}&= \begin{bmatrix} r_{1}\, \sin (\alpha )\\ r_{1}-r_{1}\, \cos (\alpha )\end{bmatrix}\nonumber \\&for\, L<l<L+z\, (passive): \end{aligned}$$
(5)
$$\begin{aligned} \begin{bmatrix} x\\ y \end{bmatrix}&= \begin{bmatrix} \cos (\beta ) &{} -\sin (\beta ) \\ \sin (\beta ) &{} \cos (\beta ) \end{bmatrix} \, \begin{bmatrix} l-L\\ 0 \end{bmatrix} + \begin{bmatrix} r_{1}\, \sin (\beta ) \\ r_{1}-r_{1}\, \cos (\beta ) \end{bmatrix}\nonumber \\& for\, l>L+z \, (bimorph~II): \end{aligned}$$
(6)
$$\begin{aligned} \begin{bmatrix} x\\ y \end{bmatrix}&= \begin{bmatrix} \cos (\beta ) &{} -\sin (\beta ) \\ \sin (\beta ) &{} \cos (\beta ) \end{bmatrix} \, \begin{bmatrix} x''+z\\ y''\end{bmatrix} + \begin{bmatrix} r_{1}\, \sin (\beta )\\ r_{1}-r_{1}\, \cos (\beta ) \end{bmatrix} \end{aligned}$$
(7)

with \(\alpha = \frac{l}{r_{1}}\) and \(r_{1} = \frac{b}{\epsilon _{1}}\), \(\beta = \frac{L}{r_{1}}\), where:

$$\begin{aligned} \begin{bmatrix} x''\\ y''\end{bmatrix}&= \begin{bmatrix} r_{2}\, \sin (\gamma )\\ r_{2}-r_{2}\, \cos (\gamma )\end{bmatrix}\end{aligned}$$
(8)
$$\begin{aligned} \gamma&= \frac{(l-L-z)}{r_{2}}, r_{2} = \frac{b}{\epsilon _{2}} \end{aligned}$$
(9)
Fig. 4
figure 4

Top: Design and dimensions of the robotic fish (Abbaszadeh et al. 2023). Buttom: Geometric base for the kinematic model used to retrieve the position feedback of the spine (Abbaszadeh et al. 2019)

The deflection as function of the strain gauge signals has been calibrated and validated with optical measurements and classical image segmentation algorithms, providing a high accuracy of 0.01 mm in air. A bending of the passive structure in between the two actuators in underwater applications will lead to a measurement uncertainty which had not been determined so far. However, this part is considered to be stiff enough to provide only negligible errors. An overview of the sensing system is provided in Table 1.

Table 1 Summary of the sensing system

2.5 Optimization objectives and design space

Aim of the procedure is to achieve the most powerful swimming mode along with lowest consumption possible for the robot at hand. The actuation with two autonomously controlled artificial muscles for the tail motion driven by the two sinusoidal signals result in five parameters for the locomotion pattern control. Therefore, the design space contains two amplitudes (\(A_1, A_2\)) and frequencies (\(f_1, f_2\)), one for each artificial muscle and a freely adjustable phase lag (\(\phi\)) in between their actuation. The objective translates in a set of two equations (\(O_1, O_2\)) to be optimized. In \(O_1\) we aim for a maximum propulsion performance \(P_{swim}\), given by \(F_{prop} \times v_{swim}\). However, in still water \(v_{swim}\) is zero for a tethered robot. In consequence, only the force \(F_{prop}\) will be maximized in both setups (one in a still water tank, a second in the laboratory flume). For \(O_2\) the electrical power consumption \(P_{cons}\) of the robot is measured at the low voltage side of the power amplifiers. In this case, the feeding voltage \(U_{feed}\) is constant at 13 V and only the instantaneous current \(i_{act}\) is captured with 200 Hz sample rate. The equations become therefore:

$$\begin{aligned} O_1&=min(-\bar{F}_{prop} )&[N] \end{aligned}$$
(10)
$$\begin{aligned} O_2&=min(\bar{i}_{feed} )&[A] \end{aligned}$$
(11)

Relating \(O_1\) to \(O_2\) the dimensionless coefficient \(C_{\eta }\) proportional to the efficiency of the system can be determined:

$$\begin{aligned} C_{\eta }=\frac{P_{swim} }{P_{cons} }\propto \frac{O_1\;[N]\cdot 1\;[m/s]}{O_2\;[A]\cdot 1\ [V]};[-] \end{aligned}$$
(12)

The subsequently showed Pareto fronts show a high initial slope which decreases and becomes almost asymptotic in its further course. As the efficiency is proportional to \(\frac{O_1}{O_2}\) the decay of the slope implies a decreasing efficiency in this area. The design space is defined by the upper and lower limits for the variables:

  1. 1.

    The normalized actuation amplitudes \(A_{1}\) and \(A_{2}\), in a bandwidth from 0 to 1, while A=0 is equivalent to 0 V and A=1 is equivalent to a driving voltages of \(-500~V\) for the contracting MFC and \(+1500~V\) for the expanding adversary,

  2. 2.

    The individual tail beat frequency \(f_1\) and \(f_2\) for both bimorphs in a bandwidth from 0 to 4.5 Hz.

  3. 3.

    The phase shift \(\phi\) between both bimorphs, in a range of \(0^\circ\) to \(180^\circ\)

The design space is later adapted as provided in Table 2. The setup does not require any additional constraints for the optimization.

Table 2 Summary of the optimization setup

2.6 Optimization procedure

Fig. 5
figure 5

Flowchart of the optimizing procedure involving PC, MCU and fish robot

Figure 5 depicts the optimization procedure. The process requires that the entire experiment has to be automated. It is governed by the in-house optimization tool called optimization algorithms library++ (OPAL++) introduced by Daróczy et al. (2014). The software is comparable to other tools for CFD-O such as the Dakota toolkit from Sandia laboratories (Adams et al. 2022). In the Exp-O method, the program communicates with the MCU using ASCII-files and by execution of customized Python code. However, OPAL++ can autonomously and platform independently call any other program or script, e.g., on a distant computer using the ssh protocol. This is necessary for CFD-O on HPC and the combined use of Windows, Mac and Linux OS-based software. It also allows for coupled simulations with experiments or to integrate more complex on-line sensing and measurement techniques such as particle image velocimetry, which is planned for future applications. The software is available to public upon request.

The optimization using GA is an iterative process involving multiple generations of individuals. It evolves as follows: after initialization with a first generation the 140 individuals are launched sequentially to the MCU by submission of the parameter set. The MCU initially collects the current state to determine the offset for forces and head angle for each individual as a time average of the signal for 3 s without actuation. This offset determination allows to prevent from any artifacts from a possible sensor drift. Furthermore, only the net hydraulic force \(F_{hyd}\) is considered without impact of the drag. We have opt for this methodology in order to mitigate possible flow fluctuations in the channel during optimization. The flow was additionally recorded repeatedly using an handheld flow meter and showed negligible variations with an average of 0.254 m/s (min = 0.27 m/s, max = 0.24 m/s, mean = 0.254 m/s, std = 0.008 m/s, n = 17).

The subsequent evaluation requires a steady flow regime. To reach it, the MCU waits for 4 s after the start of the actuation and then records the data for 10.24 s with 200 Hz sample rate and subsequently streams the buffer to the PC (see Fig. 5). This recorded data correspond to one individual of the optimization and has 2048 samples of data points for the two strain gauges \(\epsilon _1,\ \epsilon _2\) to derive the position feedback, as well as the hydrodynamic force \(F_{hyd}\), the feeding current \(I_{feed}\), and the head rotation angle \(\alpha\). The data are streamed as a flattened binary single vector over serial port to the PC.

After data acquisition the PC evaluates and stores the results. The processed data for the net power consumption (subtracting the no-load power of the amplifiers) and net propulsion force for each individual are returned to OPAL++ as a result file. OPAL++ then internally evaluates the results for each generation using the NSGA-II algorithm introduced by Deb et al. (2002) to efficiently determine the Pareto front. Subsequently, it creates a new generation with further 140 individuals. Crossover (crossover rate = 0.8) from the fittest individuals of previous generations and mutations (mutation rate = 20) of the offspring ensure both good convergence and exploration of the design space. The process commonly iterates until a predefined number of generations has been reached or the process is stopped by the user. With respect to the low evaluation cost, this study used a decent number of individuals per generation but no specific initialization algorithm to ensure a uniform, pseudo-randomized first generation like Latin Hypercube Sampling or Sobol sequences.

3 Results and discussion

The experiments are divided in two campaigns with identical settings: (1) in a still water tank (v=0.0 m/s) and (2) in running water (v=0.254 m/s) in the laboratory flume. Additionally, the second campaign in the flume was extended with a third campaign limiting the design space to 2 parameters (see Table 2 and details later in this section).

The first campaign was performed in a long, slender still water tank with 0.5 m width and 0.3 m water level. The tethered robot was fully immersed in the middle of the tank in 0.12 m water depth. The limited tank width led to reflecting waves from both side boundaries on the surface. As the results from the subsequent second experiment in the laboratory flume with a width of 1.2 m and a water level of 0.42 m show very good accordance to the findings in the narrow tank, the authors consider the boundary effects from the side walls to be negligible.

3.1 Pareto fronts

Fig. 6
figure 6

Results of the multi-objective optimization with five parameters in still water (left) and running water (right, v=0.254 m/s)

Fig. 7
figure 7

Regression of the Pareto fronts from still and running water. The differences of both regression curves remain in the uncertainty of the force measurements (left). The normalized curves (right) perfectly match

Figure 6 depicts the results of both optimization campaigns. The diagrams show the time averaged net consumption \(P_{{cons} _{net} }\) in the abscissa and the time averaged net propulsion force \(F_{prop}\) in the ordinate. \(P_{{cons} _{net} }\) is calculated from the feed voltage with constant value of \(U_{feed}\)=13 V multiplied by the time averaged net feed current, given by the difference from measured feed current to the no load current consumed by the amplifiers:

$$\begin{aligned} P_{{cons} _{net} }=U_{feed} \cdot (\bar{i}_{feed} -\bar{i}_{noload} ) \end{aligned}$$
(13)

Each diagram shows the complete optimization with 2940 individuals with a color scheme depicting the ID of individuals starting in dark violet for the first individuals and ending in light yellow for the most recent generations to provide an overview of the convergence of the optimization. The solution converges smoothly, driven by the crossover of the fittest individuals in the parent generations (the lighter colors concentrate on the front) while the algorithm continuously explores the design space driven by the mutation with randomized changes in the parameter set. (Light spots below the front which depict less successful offspring of the newer generations.) The Pareto front itself is depicted with black dots. It is well visible and nicely shaped for both experiments. The optimization can be considered to be fully converged in the low consumption/low propulsion region in the left part of the diagram. In the region of highest propulsion and consumption, the Pareto front becomes more sparse. This fact will be addressed later.

Figure 7 provides a direct comparison of the regression curves. A second order polynomial regression was performed with the data points of the Pareto front. The gray surface shows the bandwidth of the measurement uncertainty (Table 1). The regression curve for still water features a slightly higher slope and higher maximum in the net propulsion force. As aforementioned a lower course of the slope (change of tangent slope) implies a decreasing efficiency (the quotient of propulsion to consumption), even though the slope is not directly linked to efficiency. Both second order polynomial regression curves (R\(^{2}_{(v=0~{\mathrm{m/s}})}=0.993\) and R\(^{2}_{(v=0.254~{\mathrm{m/s}})}=0.995)\) are given as follows:

$$\begin{aligned} for\, v&= 0.0\, m/s : \nonumber \\ F_{prop }&= -63.19\ P_{{cons }_{net }}^2 + 368.4\ P_{{cons }_{net }} - 11.38 \end{aligned}$$
(14)
$$\begin{aligned} for\, v&= 0.254\, m/s : \nonumber \\ F_{prop }&= -39.18\ P_{{cons }_{net }}^2 + 305.7\ P_{{cons }_{net }} - 5.589 \end{aligned}$$
(15)

The higher slope is clearly expressed in the Eqs. (14) and (15). The differences of the two curves remain in the uncertainty of the measurements (Fig. 7(left)). After normalization of both Pareto fronts (\(F_{prop }/max (F_{prop })\) over \(P_{cons }/max (P_{cons })\)), the two curves match perfectly (see Fig. 7(right)). In consequence, an explicit impact of the flow on the curve shapes cannot be reported from the data at hand.

The corresponding body length based Reynolds number is of 92,710 (Re=\(\frac{v\cdot BL}{\nu }\)) using the kinematic viscosity \(\nu\) of water. This indicates a transitional boundary layer on the robotic surface which translates in high drag. The Strouhal number of 0.45 (St \(=\frac{f\cdot w}{v}\), related to the width of the robot w=0.05 m) is unexpected high. Triantafyllou et al. (1991) found typical St of free swimming fish and flapping foils to be in between 0.25 to 0.35 at Re = 25,700 (own calculation based on their paper for comparison) for highest efficiency. Senturk & Smits 2018 found a St of 0.4 to be most efficient for a flapping foil at Re = 16,000 (Senturk and Smits 2018).

It appears that in the given setup the frequency is not dominated by the flow but from the robot’s system frequency. This assumption is further underlined by the fact that the optimal actuation frequency does not change from still to running water experiments. However, it has to be noted that the natural frequency of the setup has not been assessed further.

3.2 Spot check

Table 3 Summary of the arbitrary selected individuals from the Pareto front for the spot analysis at velocity of 0.254 \(\frac{m}{s}\)
Fig. 8
figure 8

Results of the multi-objective optimization (Pareto- front, top left) and correlation of the propulsion force with the design parameters \(A_{1}\) top center, \(A_{2}\) top right, \(\phi\) bottom right, \(f_{1}\) bottom center, \(f_{2}\) bottom right) for a drive concept with five control parameters and at velocity of 0.254 \(\frac{m}{s}\)

The subsequent analysis of arbitrarily chosen individuals of the Pareto front is based on Figs. 8 and 9 for the running water case. All individuals picked from the Pareto fronts are also shown in Table 3 to provide an overview of the individuals.

For the second campaign (v=0.254 m/s, 5 parameter), the maximum propulsion force was reached at individual 2872 (ID2872) with \(F_{prop} = 411.26\) mN at consumed power of \(P_{{cons} _{net} }=1.81\) W. The parameter set is: \(A_1\) = 1, \(A_2\) = 0.54 with an almost common frequency of \(f_1\)=2.34, \(f_2\) = 2.32 and \(\phi\) = 89\(^\circ\). Using Eq. (12) an efficiency coefficient of \(C_\eta\)=228.47 can be calculated. It should be noted that the optimization was performed on a tethered device. Even though the second identical campaign has been realized at a flow velocity of 0.254 m/s (around 0.7 BL/s) with almost identical results to the still water tank setup, the optimal swimming kinematics for a free swimming device are expected to be at least slightly different.

Observing the impact of the parameters on the propulsive force in the Pareto front, the amplitude \(A_2\) shows an interesting pattern. It clearly forms into two branches of possible optimization approaches: (1) the rear muscles should either behave passively or (2) be powered with about 40% to 50% of the maximum amplitudes. Lower amplitudes were already considered to be sub-optimal and rejected in an early phase of the optimization process. Higher power provides higher propulsion but is rather inefficient. However, a gap in the dependency to \(A_2\) is found for high propulsion cases (upper right of the Fig. 8), which is addressed later. Individual 2841 with an amplitude \(A_1\) = 0.7 and a passive posterior reaches about 70% of the maximum achievable force with a reduction to 60% of power consumption. In consequence, \(C_\eta\) rises of about 12% to 255.75 with respect to the point of maximal propulsion. In this case, the optimizer benefits from the nonlinear characteristics of the MFC and reduces the amplitudes of first actuator along with a passivization of the second. However, when slightly reducing \(A_1\) to 0.65 but powering the second muscle with \(A_2\) = 0.5 combined with a phase shift of 96\(^\circ\), as shown in individual 2804, the consumption increases to 66%, while the force reaches 78% of the maximum case (ID2872). This gives an efficiency coefficient \(C_\eta\)=265.3, which is an increase of about 16% to ID2872 and the best efficiency point of the system. In all these cases, the optimizer opts for a phase shift \(\phi\) in a range of 89-95\(^\circ\) between the two muscles. This setup produces an S-shaped motion along the body during swimming.

Individual 2903, on the other hand, shows that a propulsive force of almost 95% can be achieved without significant phase shift (11\(^\circ\)). Here, the amplitudes are set to \(A_1\) = 0.88 and \(A_2\) = 0.46. In this case, the two muscles behave as one large muscle along the body. The beat frequencies of the two muscles converge to almost the same frequency, 2.3 Hz. We hypothesize that this corresponds to the natural frequency of the setup but as aforementioned we did not further investigate this point. With the given scenario, \(F_{prop}\) reached 388.4 mN and \(P_{{cons} _{net} }\) = 1.64 W, \(C_\eta\) is found at 236.8, which is 4% higher than ID2872.

With the aim to better understand the limitation of \(A_2\) to 50% for all optimal solutions and the aim to close the gaps in the upper part of the Pareto front, a third campaign with only 2 parameters was performed using the results already obtained as initial population. This time, the frequency of the two muscles was fixed to 2.3 Hz and the amplitude \(A_1\) to 0.99 remaining constant over the optimization. Amplitude \(A_2\) was allowed to vary from 0.5 to 1, while the phase shift covered the whole range from 0\(^\circ\) to 180\(^\circ\).

In Fig. 9, the entire objective space of this second campaign in running water is shown. Again all individuals were sorted from dark blue to light yellow from lowest to highest ID. The Pareto front members are depicted with black dots. The maximum propulsive force could be increased to 530.28 mN for individual 560 (ID560). \(A_2\) was 0.99 and the phase shift was 7.8\(^\circ\). Due to higher amplitude, power consumption also increased accordingly to 2.8 W. The last part of the Pareto front is very flat which means that there is no efficiency gain for this part of the curve. The comparison between individuals 481 (ID481) and ID560 shows that 93% of the propulsion force can be achieved with only 83% of the consumption (\(F_{prop}\) = 494.18 mN and \(P_{{cons} _{net} }\) = 2.31 W). The only difference in ID481 is the phase shift of 40° instead of 8° in ID560. This translates in \(C_\eta\)=191 for I560 and \(C_\eta\)= 213.9 for ID481, which is a gain of 11.8% but still 6% less than ID2872.

Comparing the most performative (ID560) and the most efficient (ID2804) individuals of the optimization, we see that the highest performance gain comes from a full actuation of both artificial muscles at the systems optimal frequency of 2.3 Hz with small phase shift 7.8°. Taking it as reference, the most efficient individual loses roughly 40% on the thrust but gains about 40% on efficiency. Here, the swimming gait is S-shaped originating from a phase shift of 96°. In consequence the robotic device would benefit from to different motion pattern depending on the flow: (1) a sprint motion corresponding to ID560 and (2) a cruise motion corresponding to ID2804.

A further simplification of the robot’s setup could be achieved by reduction of the amplifier to a device with a single channels with an inverted output of −500 V (contraction) and 1500 V (extension) for both actuation couples. This would lead to a single artificial muscle over the entire flexible part with a common actuation amplitude \(A_{1,2}=A\) and stroke frequency \(f_{1,2}=f\) without phase shift. Such a setup corresponds to ID560 (neglecting the 7.8\(^\circ\) phase shift) for maximum propulsion setting A=1 at f=2.3 Hz. An additional simple electronic would allow to set the second artificial muscle passive in order to gain efficiency for simple cruising tasks using only the first actuator couple. This setup corresponds to ID2841 and provides a significant efficiency gain compared to ID560.

Fig. 9
figure 9

Results of the multi-objective optimization (Pareto front, left) and correlation of the propulsion force with the design parameters (\(0.5< A_{2} < 1\) center, \(\phi\), right), for a drive concept with two parameters and at velocity of 0.254 \(\frac{m}{s}\)

3.3 Optimization costs

Any optimization process involving fluid mechanics is challenging. The chaotic behavior of fluids leads to complicated nonlinear equation systems which, except for purely academic applications, can only be solved numerically with very strong physical simplifications. In any engineering application this translates in extreme computational costs. The well-established CFD-O approach has been applied recently for turbine rotor shape optimization by Abdelghafar et al. (2023) using the same optimizer as in this study. This led to computational costs of 30,240 CPUh for 3 parameters and 270 individuals in 9 generations considering 74 CPU hours per individual.

In our case, a multiphysical coupling takes place additionally, since the deformations of the flexible tail fin of the fish robot have a significant influence on the propulsion force. Their stiffness has been subject to numerous optimization studies such as Zou et al. (2022).

Analyzing the benefit of Exp-O in the case at hand the computational costs have to be assessed. Khan et al. (2022) investigated the flow field around a rigid version of the same robotic fish studied here using CFD (OpenFOAMv2012). Their simulations allow for an estimation of the computational costs for a CFD-O based optimization of the task. The simulation was based on a 3D spatial discretization using roughly 4 M cells and employed an unsteady solver. The calculation time for the model (one single calculation or individual of the population respectively) was about 384 CPUh. Considering a coarser mesh and some calculation time improvements which is realistic as this is commonly done in prior to any optimization, we assume a reduction of 50%. This value is very optimistic and translates into an effort of 190 CPUh per individual.

The 5 parameter optimization performed in this study for a flume velocity of 0.25 m/s required the evaluation of 2940 individuals in 21 generations. This would translate into about 560,000 CPUh and neglect any deformation of the flexible tail fin. Accounting for these additional multiphysics (a strong coupled or two-way FSI would be required) would make for an additional costs of factor 10 as shown by Wijesooriya et al. (2021) comparing different levels of fluid-solid-coupling in a FSI study on a slender structure. Friendly estimating those 5.6 mio CPUh required for MPS-O and 560,000 CPUh for CFD-O both coming with a systematic uncertainty of such simulations (URANS, coarse mesh) the extreme benefit of EXP-O is obvious: the optimization campaign took 25:43 h for the 2940 individuals evaluated in around 31 s each. This means a reduction of factor 215,000 for the evaluation time using a single thread. To be fair, we should mention here that the real time costs can be reduced to a certain point by massively parallelized computations.

Regarding the third optimization, the entire campaign with another 16 generations and 640 individuals took 5:36 h. Here, each generation consisted of 40 individuals.

For a honest and rigorous comparison, we have to account for the entire process. The challenge for CFD-O and MPS-O methods is to define a trade-off in the necessary reduction of evaluation costs which are in contradiction to the model accuracy. For EXP-O the challenge is to set up the fully automatized experiment and the coupling of the governing system with the optimizer. Therefore, a generalized statement about a better suitability of one of the methods to any arbitrary task cannot be given.

4 Conclusions

Any multiphysical optimization in particular when involving fluid–solid interactions with large deformations is challenging. Analytical approaches are commonly computational inexpensive but lack of the necessary accuracy for most applications due to simplified physics. Numerical simulations can provide higher accuracy but mostly become extremely costly for unsteady or 3D cases. Two way-coupled FSI simulations which are necessary when large deformations occur increase the computational costs by factor 10 or even higher. Cost reduction forces the simplification of the modeling approach, e.g., by using coarse meshes for the discretization or/and simplified physics which causes inaccuracy or even unreliability in the results.

Experimental optimization approaches promise several benefits which can allow to overcome these issues in particular for application which bear complex multiphysics: (1) experiments are closer to the real physics by their nature, in theory no simplifications are necessary (2) similarity laws allow for a meaningful down scaling of the problem in most cases, in case of further reduction requirements surrogate models can be determined (3) the evaluation time for a problem is within a time scale of seconds or minutes.

Here, we propose such a method and a setup for an experimental optimization using genetic algorithms with a custom optimizer software coupled to a microcontroller via Python scripts. This controller governs a fully automatized experiment with multiple actuators and sensors.

The application case which has been chosen to present these methods is a biomimicking fish robot. The aim of the optimization is to determine the best swimming gaits for high propulsion performance in combination with low power consumption. The fish is driven by two non-conventional actuators based on piezoceramics. They allow for a fish like motion based on five control parameters, namely two amplitudes, two frequencies and a phase shift in between both artificial muscles.

The optimization involves genetic algorithms, more precise the NSGA-II algorithm and has been performed in still and running water. The results show a negligible impact of the investigated flow velocity when comparing to the still water results. A subsequent spot analysis allows to derive some particular characteristics in the optimal motion pattern for the propulsion:

  • the most performing setup is found for a synchronized actuation with full amplitude and a single frequency of 2.3 Hz with a negligible phase shift of 7.8°

  • when striving for a better efficiency, two, quite different approaches can be followed:

    1. 1.

      The second actuator can be switched off while the first is powered at 72%, which increases the efficiency of the propulsion of about 33% compared to the maximum performance, while the propulsion force is reduced by 45%

    2. 2.

      The first actuator can be powered down to 65% while the second actuator is driven with 49% amplitude in the systems frequency of 2.3 Hz with a phase shift of 96°. This S-shaped motion allows for an efficiency gain of 39% compared to the one with highest propulsion and a reduction of the propulsion force by 39%.

The results allow for the recommendation to perform two swimming gaits in dependence to the application: for cruising the second actuator could be shut off, this would allow for an additional simplification of the design of the drive system. Alternatively, the second actuator could be powered on 49% and a phase shift of 96°could be implemented. For sprinting, both actuators could be synchronized and powered with full amplitudes.

EXP-O techniques enable a massive reduction in the evaluation time for multiphysical optimization problems in realistic scenarios, e.g., in FSI for complex shapes in turbulent flows. Moreover, they allow the consideration of real flow physics without model simplification or reduction or, if necessary, the use of similarity laws to scale a model. In this study, we searched for an optimized motion law that minimizes the objective for a control task. However, the controlled motion can also be used for shape optimization. This is particularly interesting for aero- or hydrodynamic applications and turbomachinery optimization. For cases that require a complex shape change that is not possible with reasonable effort, a 3D printing approach is a great option. In this case, the optimizer will generate the parameter sets for a CAD modeler and the various geometries will be 3D printed and evaluated. A hybrid combination of actuation and 3D printing covers a very wide range of applications, e.g., a specific nozzle design with variation of the flow rate.

EXP-O methods therefore enable a systematic, accurate and economic optimization of real engineering tasks and are a perfect complement to existing CFD-O or MPS-O methods. In order to facilitate an uptake of our approach from other groups, we have made our share of code and setup publicly available and would be happy to share our methods with other scholars. The Optimizer OPAL++ can be shared upon request by the Chair of Fluid Mechanics and Technical Flows.