[insert_php]

/*

function check_input($data)

{

$data = trim($data);

$data = stripslashes($data);

$data = htmlspecialchars($data);

return $data;

}

$Nh= check_input($_POST[‘Nh’]);

*/

$html=””;

if (isset($_POST[‘Nh’])){

$Shape=$_POST[‘Shape’];

$Nh=$_POST[‘Nh’];

$Lh=$_POST[‘Lh’];

$Lwl=$_POST[‘Lwl’];

$Lbr=$_POST[‘Lbr’];

$Btr=$_POST[‘Btr’];

$Ltr=$_POST[‘Ltr’];

$Cm=$_POST[‘Cm’];

$Cp=$_POST[‘Cp’];

$Cw=$_POST[‘Cw’];

$Lbrc=$_POST[‘Lbrc’];

$kp=$_POST[‘kp’];

$ke=$_POST[‘ke’];

$kj=$_POST[‘kj’];

$Fbi=$_POST[‘Fbi’];

$Bas=$_POST[‘Bas’];

$Vawk=$_POST[‘Vawk’];

$AlphaL=$_POST[AlphaL];

$LambdaA=$_POST[LambdaA];

$engine_power=$_POST[‘engine_power’];

$con=$_POST[‘con’];

$Rm=$_POST[‘Rm’];

//beam of waterline

$Bwl=$Lwl/$Lbr;

$Bwl= round($Bwl, 3);

//—————–

//Tc

$Tc=0;

$tc_html=””;

if (($Btr != ‘-‘) || ($Btr != ‘0’) && is_numeric($Btr) ){

$Tc= $Bwl/$Btr; $Tc= round($Tc, 3);

$Ltr=$Lwl/$Tc; $Ltr=round($Ltr, 3); //If we know Btr, we can calculate Ltr

$tc_html=”**Tc = **Bwl / Btr = **$Tc** meters**note:** Tc is calculated using Beam to Draft Ratio of hull. Now we can easily calculate Length to Draft Ratio:**Ltr = **Lwl / Tc = **$Ltr**“;

}else{

$Tc= $Lwl/$Ltr; $Tc= round($Tc, 3);

$Btr=$Bwl/$Tc; $Btr=round($Btr, 3); //If we know Ltr, we can calculate Btr

$tc_html=”**Tc = **Lwl / Ltr = **$Tc** meters**note:** Tc is calculated using Length to Draft Ratio of hull. Now we can easily calculate Beam to Draft Ratio:**Btr = **Bwl / Tc = **$Btr**“;

}

//—————–

//Displacement

$Mldc=2 * $Bwl * $Lwl * $Tc * $Cp * $Cm * 1025; $Mldc=round($Mldc, 2); //fully loaded

$Mlcc=0.7*$Mldc; $Mlcc=round($Mlcc, 2); //empty boat

$Mmoc=0.8*$Mldc; $Mmoc=round($Mmoc, 2); //light loaded

//—————–

//Lrngth to Displacement Ratio

$tmp=1025/$Mldc;

$Ldr=$Lwl*(pow($tmp, 1/3)); $Ldr=round($Ldr,2);

$ldr_note=””;

if ($Ldr>4 &&$Ldr<5.7){$ldr_note="The catamaran is a heavy one and made from solid laminate.";}
if ($Ldr>5.65 &&$Ldr<6.2){$ldr_note="The catamaran has a modern sandwich construction.";}
if ($Ldr>6.1 &&$Ldr<7.6){$ldr_note="The catamaran is a performance cruiser.";}
if ($Ldr>7.5){$ldr_note=”The catamaran is a big racer or super high tech beast.”;}

//—————–

//Beam of Catamaran

$Bcb=$Lh/$Lbrc; $Bcb=round($Bcb,3); //beam of catamaran between center

if ($Shape==’U’){

$Bh1=1.4*$Bwl; $Bh1=round($Bh1,3); //max beam of hull, U shape

}else if($Shape==’Y’){

$Bh1=2.08*$Bwl; $Bh1=round($Bh1,3); //max beam of hull, Y shape

}

$Bh=$Bcb+$Bh1; $Bh=round($Bh,2); //max beam of catamaran

$Bh_pr=$Lh/$Bh; $Bh_pr=100/$Bh_pr; $Bh_pr=round($Bh_pr, 1);

//—————–

//Wet deck clearance

$Zwd=0.06*$Lwl; $Zwd=round($Zwd, 2);

//—————–

//EU Size Factor

$tmp=$Lh*$Bcb;

$Sf=1.75*$Mmoc*(pow($tmp, 1/2)); $Sf1=$Sf/1000; $Sf1=round($Sf1,1); //x10 na 3ta

$eu_category=””;

if($Sf1>15 && $Sf1<40){$eu_category="The catamaran can be certified to a **B category**.”;}else if($Sf>40){$eu_category=”The catamaran can be certified to a **A category**.”;}

//—————–

//Powering

$Pm=$engine_power*($Mldc/1025); $Pm=round($Pm, 3);

$Vm=2.44*(pow($Lwl, 1/2)); $Vm=round($Vm, 3);

$Vm_kmh=$Vm/0.539957; $Vm_kmh=round($Vm_kmh, 3);

$Vol=1.2*($Rm/$Vm)*$con*$Pm; $Vol=round($Vol);

//—————–

//Sails————

$P=$kp*$Lwl/100; $P=round($P, 2);

$E=$ke*$Lwl/100; $E=round($E, 2);

$I=0.85*($P+$Bas); $I=round($I, 2);

$J=$kj*$Lwl/100; $J=round($J, 2);

$Lambda_m = $P/$E; $Lambda_m = round($Lambda_m, 1);

$Lambda_f = $I/$J; $Lambda_f = round($Lambda_f, 1);

$Ams = 0.7*$P*$E; $Ams=round($Ams, 2);

$Aft = 0.5*$I*$J; $Aft=round($Aft, 2);

$As = $Ams + $Aft; $As=round($As, 2);

$Ag = 1.65*$I*$J; $Ag=round($Ag, 2);

$Ha = (1.01*$P)+$Bas+$Fbi; $Ha=round($Ha, 2);

$Hlp= 0.04 * (pow($Mldc, 1/3)); $Hlp=round($Hlp, 2);

$Hms= $Fbi + $Bas + (0.4*$P); $Hms=round($Hms, 2);

$Hfs= $Fbi + (0.4*$I); $Hfs=round($Hfs, 2);

$Hce= (($Ams*$Hms)+($Aft*$Hfs))/$As; $Hce=round($Hce, 2);

//—————–

//Righting/heeling moment

$RMd=10*$Mldc*$Bcb/2; $RMd1=$RMd/1000; $RMd1=round($RMd1,1); //x 10 na 3та.

$HMd=0.16*$As*$Vawk*$Vawk*($Hce+$Hlp); $HMd1=$HMd/1000; $HMd1=round($HMd1,1); //x10 na 3ta

$Md=min($RMd, $HMd); $Md1=$Md/1000; $Md1=round($Md1, 1); //x10 na 3ta

//—————–

//Stability on sailing

$FGZmax= atan($Mmoc/(254*$Lwl*2*$Bwl*$Bcb)); $FGZmax_1=$FGZmax*180/3.14; $FGZmax_1=round($FGZmax_1,1);

$LMr= 9.4*$Mmoc*((0.5*$Bcb*cos($FGZmax)) – ($Fbi*sin($FGZmax))); $LMr1=$LMr/1000; $LMr1=round($LMr1,1); //x10 na 3ta

$Awp=2*$Cw*$Lwl*$Bwl; $Awp=round($Awp,2);

$LMp = 2.45*$Mmoc*$Awp/(2*$Bwl); $LMp=$LMp; $LMp1=$LMp/1000; $LMp1=round($LMp1,1); //x10 na 3ta

$tmp=($Lh+$Lwl)/$Bcb;

$LM=0;

if ($tmp >= 4){$LM=$LMr;}else{$LM= min($LMr, $LMp);}

$LM1= $LM/1000; $LM1=round($LM1,1);

$Vw=1.6*(pow(($LM/($As*($Hce+$Hlp))), 1/2)); $Vw=round($Vw, 2);

//—————–

//Appendages

$Fs=$LMr/($Hce+$Hlp); $Fs1=$Fs/1000; $Fs1=round($Fs1,1); //x10 na 3ta

$Vuw=(1.64*pow($Vw, 0.66)*pow($Lwl, 0.3)*pow($As, 0.4)*1852)/(pow($Mldc, 0.3)*3600); $Vuw=round($Vuw,2);

$Clh=(0.1*$AlphaL)/(1+(2*$Lwl/$Tc)); $Clh=round($Clh,3);

$Cpl=$Cp*$Cm/$Cw; $Cpl=round($Cpl, 2);

$Alp=$Cpl*$Tc*$Lwl; $Alp=round($Alp, 2);

$Fh=2*$Clh*0.5*1025*$Alp*pow($Vuw, 2); $Fh1=$Fh/1000; $Fh1=round($Fh1, 2); //x10 na 3ta

$Fsb=0.5*($Fs-$Fh); $Fsb1=$Fsb/1000; $Fsb1=round($Fsb1, 2); //x10 na 3ta

$Cl=(0.1*$AlphaL)/(1+(2/$LambdaA)); $Cl=round($Cl, 3);

$Ab=$Fsb/($Cl*0.5*1025*pow($Vuw, 2)); $Ab=round($Ab, 2);

//Centerboard

$Ad=0.75*$Ab; $Ad=round($Ad, 2);

$Td=pow(($LambdaA*$Ad), 1/2); $Td=round($Td, 2);

$Cd=$Ad/$Td; $Cd=round($Cd, 2);

//Rudder

$Ar=0.25*$Ab; $Ar=round($Ar, 2);

$Tr=pow(($LambdaA*$Ar), 1/2); $Tr=round($Tr, 2);

$Cr=$Ar/$Tr; $Cr=round($Cr, 2);

//—————–

//Performance

$tmp=(1.2454*pow($Cm, 3))-(1.4545*pow($Cm, 2))+(0.6935*$Cm)+0.8614; $tmp=$tmp*$Awp;

$Aws= pow((pow($Bwl, 2)+pow(2*$Tc, 2)), 1/2)*$tmp/$Bwl; $Aws=round($Aws, 2);

$SWR=$As/($Aws + (4*$Ab)); $SWR=round($SWR, 2);

$SDR=$As/pow(($Mldc/1025), 0.667); $SDR=round($SDR, 2);

$BN=pow(10.764*$As, 1/2)/pow(2.2046*$Mldc, 1/3); $BN=round($BN, 2);

//—————–

//Speed

$Vuw1=(1.64*pow($Vw, 0.66)*pow($Lwl, 0.3)*pow($As, 0.4))/pow($Mmoc, 0.3); $Vuw1=round($Vuw1, 2);

$Vuw2=(1.64*pow($Vw, 0.66)*pow($Lwl, 0.3)*pow(($Ams+$Ag), 0.4))/pow($Mmoc, 0.3); $Vuw2=round($Vuw2, 2);

//—————–

//Costs

$Euros=4*$Ldr*$Mlcc; $Euros=$Euros/1000; $Euros=round($Euros, 1); //x10 na 3ta

$Hours=$Ldr*$Mlcc/6; $Hours=$Hours/1000; $Hours=round($Hours, 1); //x10 na 3ta

//—————–

$html=”

__Multihull Cruiser Calculations__

for $Nh Hulls, $Lh meters long and $Shape-shape hull…

**1. Beam of waterline:**

**Bwl = **Lwl / Lbr = **$Bwl** meters

**2. Draft (sinking of the hull):**

$tc_html

**3. Displacement:**

**Mldc =** 2 * Bwl * Lwl * Tc * Cp * Cm * 1025 =** $Mldc** kg of water [fully loaded]

**Mmoc =** 0.8 * Mldc =** $Mmoc** kg of water [light loaded]

**Mlcc =** 0.7 * Mldc =** $Mlcc** kg of water [empty]

**4. Length/Displacement Ratio:**

**Ldr = $Ldr**

**note:** $ldr_note

**5. Beam of Catamaran:**

Maximal Beam of one hull (for $Shape-shape):

**Bh1 = $Bh1** meters

Beam of catamaran between hull centers:

**Bcb = $Bcb** meters

Maximal beam of catamaran:

**Bh = $Bh**meters [$Bh_pr% of Length]

**6. Minimum Wet-Deck Clearance:**

**Zwd = $Zwd** meters [on fully loaded conditions]

**7. EU Size Factor:**

**Sf= $Sf1 x 10 ^{3}**

**note:**$eu_category

**8. Powering:**

Required Engine Power:

**Pm = $Pm** KW

Motoring Speed:

**Vm = $Vm** knots [$Vm_kmh km/h]

Fuel Tank Size (with 20% reserve), for a range of $Rm nautical miles:

**Vol = $Vol** liters

**9. Sails Dimensions:**

Mainsail Luff:

**P = $P**meters

Mainsail Base:

**E = $E**meters

Fore triangle height:

**I = $I**meters

Fore triangle base:

**J = $J**meters

Mainsail aspect ratio:

**Λm**= P/E

**= $Lambda_m**

Fore Triangle aspect ratio:

**Λf**= I/J

**= $Lambda_f**

**note:**Change the value of

**kj**to change Λf. Keep the value between 2.8 and 3.5 (best is 3.0 – 3.2).

Mainsail Area:

**Ams**= 0.7 * P * E

**= $Ams**m

^{2}

Fore Triangle Area:

**Aft**= 0.5 * I * J

**= $Aft**m

^{2}

Gennaker area:

**Ag**= 1.65 * I * J

**= $Ag**m

^{2}

**note:**For calculating the sails area, a coefficient of 0.7 has chosen for high roach on the main sail; 0.5 is standard.

Total sail area:

**As**= Ams + Aft

**= $As**m

^{2}

Air Draft:

**Ha**= 1.01*P + Bas + Fbi

**= $Ha**meters

Height of underwater lateral center:

**Hlp = $Hlp**meters

Height of mainsail center:

**Hms = $Hms**meters

Height of fore triangle center:

**Hfs = $Hfs**meters

Height of center of effort:

**Hce**= (Ams*Hms + Aft*Hfs)/As

**= $Hce**meters

**10. Righting / heeling moment (ISO 12215-9):**

Righting moment:

**RMd**= 10*Mldc*Bcb/2

**= $RMd1 x 10**Nm

^{3}Heeling Moment:

**HMd**= 0.16*As*Vawk*Vawk*(Hce+Hlp)

**= $HMd1 x 10**Nm

^{3}**note:**The

**righting moment**of catamaran is caused by the boat size. For the

**heeling moment**is using the

**design wind speed**, which for cruising catamaran <=18m is typically

**Vawk=32 knots**. With the bigger catamarans can be lower, so you are able to adjust

**Vawk**in the initial input of the calculator, to get the right

**Hmd**.

Design moment of mast:

**Md**= min(RMd, HMd)

**= $Md1 x 10**Nm

^{3}**note:**On small catamarans the righting moment RMd is bigger than the heeling moment HMd and then the design moment is the righting moment. On bigger cat’s the opposite is true and so their design moment is the heeling moment.

**In general the smaller moment will be chosen**.

**11. Stability on sailing (ISO 12217-2)**

**note:** For the safety sake a sailor need to know when it is the time to reef. In a catamaran this is indicated with the **reefing wind speed, Vw** (apparent wind).

Heel angle of maximum righting arm:

**ΦGZmax** = atan(Mmoc/(254*Lwl*2*Bwl*Bcb)); ΦGZmax=ΦGZmax*180/3.14 **= $FGZmax_1** deg

Limiting moment in roll for a catamaran:

**LMr** = 9.4*Mmoc*((0.5*Bcb*cos(ΦGZmax)) – (Fbi*sin(ΦGZmax)))**= $LMr1 x 10 ^{3}** Nm

Water Plane Area:

**$Awp**= 2*Cw*Lwl*Bwl

**= $Awp**m

^{2}

Limiting Moment in pitch for catamaran:

**LMp**= 2.45*Mmoc*Awp/(2*Bwl)

**= $LMp1 x 10**Nm

^{3}Limiting Moment chosen to be used:

**LM = $LM1 x 10**Nm

^{3}**note:**If the calculation of the estimated hull size (Lh+Lwh)/Bcb is >= 4, LMr will be used to calculate Vw. If the result is < 4, the lower value of (LMr, LMp) will be used

Reefing wind speed (apparent wind) will be:

**Vw**= 1.6*(square_root((LM/(As*(Hce+Hlp)))))

**= $Vw**knots

**note:**If the reefing wind speed is unnecessarily high, simply increase the

**mainsail luff ratio kp**, and if reefing wind speed is too low, decrease it.

**12. Appendages**

Builders of keel cats often add daggerboards to their designs, with the objective to market increased performance and safety. This usually results in a compromise when considering the hydrodynamic hull requirements of both types, which might differ substantially; proper integration, engineering, and construction become crucial factors.

The appendages as a hulls and/or boards need to create lift enough to have acceptable leeway.

Maximum Side Force of the catamaran:

**Fs**= LMr/(Hce+Hlp)

**= $Fs1 x 10**N

^{3}Maximum Boat Speed, using nominal sail area, fully loaded:

**Vuw**= (1.64*Vw

^{0.66}*Lwl

^{0.3}*As

^{0.4}*1852)/(Mldc

^{0.3}*3600)

**= $Vuw**m/s

Next we’ll estimate how much side force is taken by the hulls. It will be handled by the hulls without using boards.

Lift coefficient of the hull:

**Clh**= (0.1*αL)/(1+(2*Lwl/Tc))

**= $Clh**

Longitudal prismatic coefficient of the hull:

**Cpl**= Cp*Cm/Cw

**= $Cpl**

Lateral area of the hull:

**Alp**= Cpl*Tc*Lwl

**= $Alp**m

^{2}

Lateral force (side force) of the hulls:

**Fh**= 2*Clh*0.5*1025*Alp*Vuw

^{2}

**= $Fh1 x 10**N

^{3}The rest of the side force must be handled by the boards (daggerboards).

Lateral force (side force) of one board:

**Fsb**= 0.5*(Fs-Fh)

**= $Fsb1 x 10**N

^{3}Lift coefficient of boards:

**Cl**= (0.1*αL)/(1+(2/ΛA))

**= $Cl**

Lateral area of the boards in one hull:

**Ab**= Fsb/(Cl*0.5*1025*Vuw

^{2})

**= $Ab**m

^{2}

**Centerboard**

Centerboard must be around 75% of the board area.

Area of the centerboard:

**Ad**= 0.75*Ab

**= $Ad**m

^{2}

Draft of the centerboard:

**Td**= (ΛA*Ad)

^{1/2}

**= $Td**m

Chord of the centerboard:

**Cd**= Ad/Td

**= $Cd**m

**Rudder**

Rubber must be around 25% of the board area.

Area of the rudder:

**Ar**= 0.25*Ab

**= $Ar**m

^{2}

Draft of the rudder:

**Tr**= (ΛA*Ar)

^{1/2}

**= $Tr**m

Chord of the rudder:

**Cr**= Ar/Tr

**= $Cr**m

**13. Performance**

The performance of cruising catamaran is the actual reason for all calculations. It is the most important indicator is the input data will give us the fastest, the most economical and most secured vessel.

Wetted surface of catamaran:

**Aws** = … **= $Aws** m^{2}

Sail area / wetted surface ratio (included boards):

**SWR** = As/(Aws+4*Ab) **= $SWR**

**note:**The sail area to wetted surface area ratio should be more than 2.5, to show a fast boat in light wind.

Sail area / displacement ratio:

**SDR** = … **= $SDR**

**note:**If SDR is grater than 20, in general means good performance.

Bruce Number:

**BN** = pow((10.764*$As), 2)/pow((2.2046*$Mldc), 3) **= $BN** imperial units

**Boat speed**

Average boat speed potential with jib or genoa:

**Vuw1** = … **= $Vuw1** knots

Average boat speed potential with gennaker:

**Vuw2** = … **= $Vuw2** knots

**14. Cost estimation**

Material cost:

**Euros** = 4*dr*Mlcc **= $Euros x 10 ^{3}** EUR

Hours of work:

**Hours**= Ldr*Mlcc/6

**= $Hours x 10**hours

^{3}**note:**Ldr (length/displacement ratio) is included in estimation, because building a lighter boat needs more time and the materials are more expensive. In general the building of time and cost are proportional to the mass of the empty boat Mlcc.

“;

}else{

//=============================================================

$html=”

__Multihull Cruiser Calculator__

}

echo $html;

[/insert_php]