To use the example files, you must save the indicated example file as in.mlt in the main Michlet directory (i.e. the directory that contains the executable file). This will overwrite the current in.mlt with the example input file.
It is probably a good idea to go through these examples with the appropriate file loaded into your text editor, or to have a printout handy.
Note that the number of theta intervals, Ntheta, used in the calculation of the wave resistance and wave patterns has sometimes been set to small values in these examples. For serious design work, these should be increased to the values recommended in the Michlet manual. Better still, before embarking on a large design project, you should calculate resistances using different values of Ntheta to see how many are required for reasonable accuracy. Similar convergence tests should also be performed with the number of hull stations and waterlines.
Also note that some plots will not be displayed until after the population has been initialised.
The first part of the gin1.mlt file contains the dimensions and offsets for a one tonne hull. The offsets in the table are for a Wigley standard parabolic hull, however for the present examples they can be considered as dummy arguments. Note that we have used the parametric form for the offset table. Because the offsets in this section are just dummy arguments, there is no need to use a table of offsets, although we could if we wanted to, but the input file would be longer and difficult to print out.
The length has been set to 10.0 metres and the draft to 0.25 metre. The first hull in the population will have these dimensions, as long as the dimensions do not violate the constraints specified later in the input file.
The default random seed is 1. For real design problems, the program should be run multiple times, each time varying only the value of the random seed. If the optimum vessels found after many runs are very similar, then we can claim with a little more confidence that we are close to the (global) optimum solution. Of course, there is no absolute guarantee. It must also be stressed that if this random seed is not changed, and if GODZILLA is run again with the same input file, exactly the same sequence of hulls will be produced. This can be either a blessing or a curse. A boon if you want to reproduce a particular run, or a real nuisance if you remember, six hours into a run, that you forgot to change the seed and that you are going to get exactly the same answer as last time.
The number of ships in the population has been set to 20, which is a reasonable value for a small design problem. For larger problems, i.e. when there are many parameters participating in the optimisation, a larger population will be slower, but less prone to becoming trapped in local minima.
The default objective for this example is 0, i.e. minimising the total surface area. The objective variant is equal to 0.
The design speed is U = 6.0 ms-1.
The hull shape function is 1. This function takes three shape parameters and is described elsewhere in the manual. In brief, the first parameter controls the shape of the waterlines, the second controls cross-section shape, and the third determines the shape of the sideviews. A value close to 0.0 means the shape is roughly rectangular, a value of 0.5 indicates an elliptical shape, while values close to 1.0 are roughly parabolic.
The next five parameters limit the overall displacement , overall length, and overall width of the vessel. For monohull design problems, these constraints can be set to cover a very wide range of values. In that case, the constraints for the individual hull (which are to be specified a little further on in the input file) will control the size of the vessel.
The constraints on ship motions, pressure signatures, and other special constraints are not used in this version of Michlet. Leave them set to 0.
The minimum and maximum hull displacement are both set to 1.0 which means that the displacement will not vary during the optimisation. It is rarely wise to allow displacement to vary during the optimisation of monohulls. In most cases, the minimum resistance will occur for the hull with the smallest allowable displacement. This is not necessarily so for multihulls, where we might want to find the optimum size of outriggers.
For the present example, length and draft are allowed to vary over a (deliberately) very wide range for a one tonne vessel.
The ranges for the hull shape parameters are specified next. For the hull shape function we are using in this example, we need to specify constraints on three input parameters and to also specify the seed value for each shape parameter. This is done by supplying one row of three comma-separated values for each shape parameter. In this example, we allow each parameter to take values between 0.0 and 1.0. The seed value for each parameter is 1.0.
Following the shape factor section of the input file, there is a list of constraints on a variety of geometric quantities. The ranges for these various parameters have been made very large for the present examples.
For the next part of this example, run the program as before and initialise the population by pressing g from the Lines Drawing screen.
There will be times during an optimisation run when you might want to enter your own guess for the best hull. For example, for the present problem we know the exact answer; to at least 5 figures, the (mathematical) optimum for this problem is a hemisphere of length L = 1.563185m and draft T = 0.781593m. The three shape factors are all equal to 0.5 (i.e. elliptical in all views).
Sometimes global optima will occur in a very wide shallow basin, and quite large variations in one or more of the parameters will not seem to produce any noticeable effect on the fitness. Other times, small changes in for example, design speed, can lead to large changes in the optimal values of the hull parameters.
Since viscous drag depends on surface area, we expect that the optimum hull will be similar to the hull of minimum surface area found in the previous example. (It won't be exactly the same because of Reynolds number effects).
With this objective and with the chosen constraints, the hulls can be seen to get very long and very deep, eventually becoming very thin plates. This objective function is not particularly useful for relatively unconstrained monohull designs; its real value will be seen in the multihull examples where we use it to optimise the placement of hulls with respect to each other.
As the optimisation progresses, the best hulls tend towards fine canoe bodies. The best fitness (in this case total resistance) I found was about 0.44kN.
In the introductory examples, many of the hull dimensions were not particularly tightly constrained. As an example of a slightly more realistic problem, we will try to minimise the total resistance of a small sprint kayak of displacement volume D = 0.098 m3 and for a design speed of U = 5.0 ms-1.
The length of the kayak is required to lie between 4.0 and 5.2 metres, the draft must be between 0.01 and 0.3 metres, and the beam must be between 0.35 and 0.75 metres. The maximum value of the beam could be set to a much larger value, but there are good reasons to keep it relatively small. During the optimisation, wave resistance is not calculated for hulls that have violated any constraints. Since this is the most time-consuming part of the calculations, we do not want to calculate wave drag for hulls that are unlikely to be competitive. In this case, however, even a beam of 0.75 metres is probably too wide to be practical.
The hull shape function (number 7) for this example is the seven parameter function described in the Michlet manual. This hull series contains fore and aft asymmetric hulls, and hulls with parallel middle bodies. The minimum value for all seven shape factors is 0.0. The maximum value for the first 5 parameters is 3.0, and for the last two parameters, the maximum value is 0.75. The first five shape parameters define the shapes of the forebody and afterbody. A maximum of 3.0 for these parameters means that we allow cusped hulls. The final two shape parameters determine the relative lengths of the forebody and afterbody. The length of the forebody will be allowed to take any value between 0.0 and 0.75; i.e. the forebody can comprise up to 75% of the total hull length. The length of the afterbody can also vary between 0.0 and 0.75 of the length of the hull with the following proviso. If the sum of the last two parameters exceeds 1.0, then the length of the afterbody is reduced so that the sum of the two parameters is equal to 1.0. In other words, the forebody and afterbody together cannot comprise more than the total hull length; if the forebody comprises 75% of the hull length, the afterbody fraction will not be greater than 25%. If the sum of the two last parameters is less than 1.0, then the remaining fraction of the hull length is parallel middle body.
The LCB of the vessel is required to lie between 0.14 metres aft of centre and 0.025 metres aft of centre (i.e. between -0.14 and -0.025). The VCB is required to lie between 0.065 metres and 0.3 metres; VCB is not of great interest here, and nor is the location of the LCF which is allowed to take a very wide range of values. The values and limits of these quantities have been chosen for the sake of example only - they are not necessarily the best choices for real kayaks.
The offsets for the default hull are defined using Hull Series 7.
There are many other optimisation runs that could be attempted. What hulls would be found if the LCB limits were relaxed? How does the inclusion of a form factor in the calculation of the total resistance affect the hull shape? What effect do different water densities and viscosities have? What if we optimised over a range of speeds?
If hollows in the hull shape are prohibited by competition rules, the optimisation should be done using limits on some of the shape parameters. Specifically, for the hullform family used in this example, Hull Series 7, the maximum for the first 5 shape factors should be set to 1.0. This will guarantee that the hull does not have hollows in the waterlines or sections.
This example uses objective function 2, i.e. we will minimise the wave resistance. The hull shape function has been set to 1 which means that we will use a mathematical hull series. However, later in the file we constrain the shape parameters so that they cannot change during the course of the optimisation.
The only parameter that can change in this example is the lateral hull separation, w, which is required to lie between 2.0 metres and 15.0 metres inclusive.
My optimum was about w = 5.5 metres.
For this 1-parameter optimisation we could manually plot the wave drag for various demihull spacings and find the best separation. A more difficult problem would be to optimise for total drag (change the objective function to 3) and to also search for the best shapes from, say, the Series 1 hullform family (change the hull shape function to 1). Remember to allow the shape parameters for both hulls to vary during the optimisation! This will be a 7-parameter optimisation (1 lateral separation distance and 3 shape parameters for each demihull). This can be reduced to a 4-parameter problem (1 lateral separation distance and 3 shape parameters) using the Special Ship Constraint option to force the demihulls to have identical shapes and dimensions.
For this example, save the gdiwave.mlt file as in.mlt in the main Michlet directory.
The size and shape of demihulls for the vessel are the same as those in the gcatin.mlt file, however only 21 stations and 11 waterlines are used in order to speed up execution.
The maximum speed is 6.0 ms-1, the same as the design speed. In GODZILLA mode, the value for the speed in the Wave Analysis menu cannot be changed while the program is running; it is always the maximum speed defined near the start of the input file. Using the same value for the maximum speed and the design speed allows us to look at intermediate results. If a different maximum speed had been specified, we would only be able to see intermediate graphs for that speed and not the design speed.
To illustrate some principles of wave minimisation, the location of Hull 2 is allowed to vary both laterally and longitudinally. Of course, the resultant asymmetric arrangement is not necessarily going to be a practical solution to a real problem, but the methodology is the same when vessels are required to have lateral symmetry.
The objective function has been set to 2, i.e. minimum wave resistance.
Now press G to initialise and run GODZILLA. After about 600 evaluations, pause GODZILLA by pressing the space bar. My best vessel had a longitudinal stagger of about s = 7.2m, and a lateral stagger of about w = 0.8m. When the GODZILLA IDLE message appears, press W to display the Wave Analysis menu. Note that none of the parameters in this menu can be changed in GODZILLA mode.
Press L to show wave elevations along the longitudinal cut. The minimum wave amplitude is about -0.023m, the maximum is about 0.02m.
Press Esc to return to the Wave Analysis menu, then press F to show the free wave spectrum. For me, the largest peaks in the spectrum were at about theta = -80 degrees and theta = 80 degrees. Negative theta means waves propagating to starboard, positive theta is for waves on the port side of the vessel. Waves travelling at theta = 0 are those following the vessel, i.e. pure transverse waves. Waves travelling for theta near plus or minus 90 degrees are those high frequency diverging waves travelling outwards and more parallel to the ship's track.
You can see the wave pattern for the vessel by pressing R from the Wave Analysis menu. For the 301 x 301 = 90601 points in the rectangular patch, this takes about 1 minute to calculate on a 2GHz PC. Note that the wave pattern is not truescale: the rectangular patch is 200m long but only 100m wide. Also note the 'streaking' of the wave pattern. This is caused by using too small a value for Ntheta. Increasing Ntheta to 1024 will eliminate the streaking at the expense of a longer execution time.
# Objective Function (integer: see Manual)
6
# Objective Function Variant(integer: see Manual)
0
50.0, 50.0, 250.0
Objective function 6 means that we will minimise waves along a longitudinal cut. The line after the objective function means that we will search from x1 = 50.0m and y1 = 50.0m to x2 = 250.0m. The positive y-value means that the longitudinal cut is on the starboard side of the vessel. The number of points along the cut that will be tested during the optimisation is specified in the definition of the rectangular patch earlier in the in.mlt file. In this example, we use 301 points. Therefore, we will search for a hull arrangement that minimises the wave elevations at 301 points from 50.0m aft of the centre of Hull 1 to x = 250.0m.
Run GODZILLA and pause the optimisation after about 600 function evaluations. The optimisation proceeds somewhat more slowly than when we were using minimum wave resistance as an objective function. The process could be sped up by using fewer points along the cut, but then we might miss some large peaks or troughs. We could also use a smaller value of Ntheta, but then the accuracy of the predicted wave heights might be compromised.
My best ship had s = 9.3m, and w = 1.6m for the lateral and longitudinal spacings, respectively. The minimum wave amplitude was z = -0.01 and the maximum was 0.01m. Of course, we might be able to do better if the program was run for longer.
-90.0,-45.0
Your input file should now look like the following:
# Objective Function (integer: see Manual)
4
# Objective Function Variant(integer: see Manual)
0
-90.0, -45.0
We will now try to minimise the energy shed for wave propagation angles from theta = -90.0 to theta = -45.0. (Note that GODZILLA requires that the first angle be less than the second angle.) Waves travelling between these angles of propagation are high frequency diverging waves shed to starboard.
Run GODZILLA for about 600 function evaluations and then pause the optimisation. My best vessel had s = 8.39m and w = 1.21m. Examination of the free wave spectrum shows that the largest peaks occur for positive values of theta.
Stop execution, exit, and then change the line after the objective variant to read
45.0, 90.0
Using positive angles means that we will minimise waves shed on the port side of the ship.
Run GODZILLA for about 3500 function evaluations and then pause the optimisation. My best vessel had s = -8.1m and w = 1.1m, i.e. Hull 2 is now forward of Hull 1, whereas when we were optimising for negative theta, Hull 1 was forward of Hull 2. Examination of the free wave spectrum shows that the largest peaks now occur for negative values of theta, i.e. the largest waves are now shed to starboard.
The hull shape function has been set to 1; Hull Series 1 will be used to generate offsets during the optimisation.
The objective function has been set to 3, i.e. minimum total resistance.
As it stands, this is an 11-parameter optimisation problem; we must find the length, draft, and three shape parameters for each demihull, and the lateral separation distance between the hulls.
By using a value of 1 for the Ship Special Constraint, the problem can be reduced to a 9-parameter problem. GODZILLA needs to find one hull length, one hull draft, three shape parameters for each hull, and one lateral separation distance.
The size of the problem can be reduced further by using a value of 2 for the Ship Special Constraint. In this case, GODZILLA needs to find 6 (primary) parameters: one hull length, one hull draft, three shape parameters, and one lateral separation distance.
Note that the number of parameters shown on-screen in the GODZILLA panel is 11 for all three cases even though the program actually needs to find fewer than 11 optimal parameters when using Special Ship Constraints.
The displacement volume of all demihulls is D = 1.0 m3, the length of the demihulls is L = 11.537 metres, and the draft is T = 0.254 metres.
The hull shape function is 0, i.e. the program will use the offsets defined in the offset data section of the file. For Hull Series 1, the given three parameters define a Wigley hull.
Because we are using Hull Shape Function 0 in the GODZILLA section, the three hulls will retain the Wigley shape throughout the optimisation. It is important to note how we handle the minimum, maximum and seed values for this case. A single (dummy) value, of 999.99 is used instead of the method where we provide three comma-separated to signify the minimum, the maximum and the seed values for each shape parameter. When using Hull Shape Function 0 there are no shape parameters to constrain, but the program expects a value in that part of the input file.
The lateral separation distance, w, for the first outrigger (Hull 2) is constrained to lie between a minimum of 2.0 metres and a maximum of 15.0 metres from the central hull (Hull 1); for the second outrigger (Hull 3) the separation distance is constrained to lie between a minimum of -15.0 metres and a maximum of -2.0 metres from the central hull. (Note how the minimum and maximum values are defined when negative values are used). For both outriggers, the longitudinal separation distance must lie between 0.0 metres and 12.0 metres from the centre of the central hull.
This optimisation problem has four parameters; two longitudinal separation distances and two lateral separation distances. For a trihull with symmetrically-placed outriggers, this can be reduced (effectively) to a 2-parameter problem (one longitudinal and one lateral separation distance) by using a value of 1, 2 or 3 for the Special Ship Constraints field. In this example, any of these three values will result in the same hull arrangement because the three hulls have the same displacement, and the lengths, drafts and shapes are not allowed to vary.
In the first instance, run this example using a value of 0 for the Ship Special Constraint. No symmetries will be maintained during the optimisation.
Now run the example using a value of 1 for the Ship Special Constraint. In this case, the outriggers will be forced to be identical to each other and they will be symmetrically placed around the central hull. Thus the problem has been (effectively) reduced to a 12-parameter problem: we need to find one length, one draft and three shape parameters for the central hull, one length, one draft, and three shape parameters for the amas, and one longitudinal and one lateral separation distance.
Using a value of 2 for the Ship Special Constraint reduces the optimisation to a 9-parameter problem: one length, one draft and three shape parameters for the central hull, one length and one draft for the amas, and one longitudinal and one lateral separation distance.
We cannot use a value of 3 for the Ship Special Constraint in this example: that symmetry condition requires that all demihulls have identical displacements.
After about 1200 evaluations, hulls seem to form a diamond pattern.
In the description of the parameter Ntheta in the Michlet manual, it was mentioned that some calculations in Michlet are exact for Wigley hulls. We can take advantage of this in the present example where we are only concerned with the wave resistance of Wigley hulls.
To see how this can enormously speed up calculations, change the value of Ntheta from 256 to -256 in the in.mlt file. Also change the number of stations and waterlines so that both are equal to 5. Now run GODZILLA.
It should be very clear that the search proceeds much more quickly. More importantly, exactly the same sequence of 'best' hulls are found as in the original situation where 21 stations and 11 waterlines were used. The reason for this is that Michlet calculates the Michell P,Q functions exactly, irrespective of the number of stations and waterlines (as long as they are both greater than or equal to 5). Note that using a very small number of stations and waterlines is not appropriate for other hull shapes, and certainly not if we are calculating total resistance where we need an accurate estimate of the hull surface area.
This example is really only useful as a template for your designs. However, it is probably instructive to watch the screen as the optimisation progresses for a while, and contemplate what would be required if we wanted to perform a brutish, exhaustive search of the parameter space. For example, if we were satisfied to find the 'optimum' value of each of the parameters to an accuracy of one part in 100, we would need to evaluate 10058 = 10116combinations!
The ship is assumed to be located at x=0.0, y=0.0. We also assume that it is travelling at a speed of 17.6679ms-1.
Hull Series 1 is used to estimate the shape of the hull. This hull series requires three parameters. We also wish to know the displacement volume, the length, and the draft, making six unknown parameters in total.
To run this example, save the file gid1.mlt as in.mlt in the main Michlet directory (i.e. the directory that contains the executable file). This will overwrite the current in.mlt with the example input file. You must also save the wave elevation file gid1recp.mlt as userrecp.mlt in the same directory.
Run the program. The initial guess for the hull dimensions and shape are specified in the in.mlt file. Here we have taken the midpoint of the ranges allowed to certain parameters. For example, the vessel displacement volume is constrained to lie between 100m3 and 10000m3, and the initial guess is 5500m3. Initial estimates for the length, and draft and the three hull shape parameters are calculated in the same way. If you have worked through the previous examples, you should be able to see that the initial hull is half a spheroid. (The three shape parameters are each equal to 0.5, which, for Hull Series 1, means that the sections, waterplanes and buttocks are all elliptical.)
Note that if you go to the Wave Analysis menu (by pressing the W key), you will not yet be able to view the longitudinal cuts since they have not been calculated for the initial hull. Go back to the main menu by pressing Esc.
Press the g key to initialise the search. The vessel initially shown on-screen will change and then the search will stop. The fitness function for this objective is the RMS of the differences between the 'target' wave elevations and the 'found' elevations. Now go to the Wave Analysis menu (press W) and then press L to view the longitudinal wave cuts. The plot shows the 'target' wave elevations in red and pink; 'found' elevations are in green and yellow. Only the red curve and the green curve will be visible because the two target wave cuts (one at y=-100m and y=100m) are identical. Similarly, because the vessel is located at y=0.0m, only one 'found' curve will be discernible.
The two curves should already be reasonably similar which is not particularly surprising since we have assumed that the location of the hull, its heading, and its speed are all known. The target wave cuts for this example were produced by running Michlet with a Series 1 hull, so that too would tend to bias the agreement.
Go back to the main menu and press G to continue the search. As the search proceeds the hull should begin to look more and more like the Wigley hull that was used in previous examples in this manual. After about 1000 evaluations, press a key to (eventually) stop the search, and look at the comparison of the wave cuts.
After about 7000 evaluations, the target and the found wave cuts are almost identical. So how well did we do in predicting the dimensions of the unknown ship?
The target ship was a 2777.8 tonne Wigley hull (we estimated 2780.5t) of length 100m (we estimated 97.7m) and draft 6.25m (we found 6.75m). Thus the volume and length were predicted reasonably well, but the draft estimate was fairly poor. This is typical in these sort of inverse ship problems for fairly complicated reasons to do with wave generation and its dependence on depth.
The Hull Series 1 shape parameters for the Wigley hull are (1.0, 1.0, 0.0): we found (0.793, 0.279, 0.276) which, on face-value, is barely acceptable. On the positive side, however, it does seem to confirm that the details of hull shape are not that important in the generation of far-field waves by thin ships: displacement, length, beam and location are more important. In a more formal study, the search should , of course, be repeated using different seeds for the random generator.
Although there are obvious military applications for this type of search, there are also several interesting hydrodynamic aspects. For example, if the target wave elevations are all zero, then the problem can be thought of as a wake minimisation problem, or even as a wave resistance minimisation problem. In these cases, as with the estimation of wave resistance using experimental data in towing tanks, results can be unreliable if the wave cut is too short. There are many other research studies being pursued by the present author and other workers that are unlikely to be resolved soon, or without controversy. What are the effects on the ship wave pattern of viscosity, surface tension, ocean waves, currents, and wind? How do these affect the predicted ship dimensions? Adding noise to the wave elevations in the userrecp.mlt file can give some minor insights.
Clearly we should not expect to be able to predict the exact shape of a vessel from, for example, blurry photographs or radar images of wave wakes, but what is it reasonable to expect? It is unlikely that we will be able to predict the speed and length of a vessel purely from considerations of waves in an inviscid fluid. Would including viscosity and surface tension help?
Note that this example cannot be used to estimate the location of the hull. The first hull in Michlet is always located at x=0.0, y=0.0. To estimate the location we could use two hulls and make the first hull very small so that it does not significantly affect the wave pattern.