%calculates Resistance, power and equilibrum angle of ship %original file name: calculateResistance.m % %required: Vs - ship speed opt.: lcg (longtitudal center of gravity, beta %(beam rise) % %returns: Resistance at speed, required power at that speed, equilibrum %trim angle % %Example: calculateResistance(10,1.96,14) %calculates Resistance at 10m/s, lcg=1.96m from transom, 14 deg chine rise % %Note: Tuned to the Stromboot, other ships may need other default %parameters! %Also the appendage resistances % %Author: Simon Egli (smn.egli At gmail Dot Com), 14.04.2012, www.hsr.ch %Feel free to use this script, a shoutout would be great %Copyright: CC-BY function[resistance, power, tau0] = calculateResistance(Vs, lcg, beta) global pmes; %pmes is a structure with all the needed information ignoreBoundaries=0; %Parameter von unserem Boot m=pmes.mes.m; %Boot+3Mann mit Ausrüstung [kg] %lcg=1.966; %von hinterstem Tei aus [m] vcg=pmes.vehicle.vcg; %von unterstem Teil aus [m] b=pmes.vehicle.beam; %beam [m] epsilon=pmes.vehicle.shaft_angle; %schaft winkel [deg] %beta=14; %chine rise [deg] f=vcg; %perpendicular distance of shaftline to centre of gravity (nach Bild ist das bei uns gerade gleich vcg, da aus Mitte rauskommt) %Vs=30; theta=pmes.vehicle.theta; %Angle between the keel (centerline) and the outer edg e of spray area measured in plan of bottom g=9.81; %Gravity-constant [m/s^2] rho=1000; %Dichte von Wasser [kg/m^3] rhoair= 1.2041; %Dichte Luft, Meereshöhe (20°C) Aair=pmes.vehicle.airArea; Askeg=pmes.vehicle.skeg_area; Arudder=pmes.vehicle.rudder_area; Lshaft=pmes.vehicle.shaft_length; Dshaft=pmes.vehicle.shaft_diameter; L=pmes.vehicle.norm_diameters(1); if(nargin==1) lcg=pmes.vehicle.lcg; beta=pmes.vehicle.beta; end if ignoreBoundaries==0 if beta>30||beta<10 %schauen ob Grenzen eingehalten resistance=0; power=0; tau0=0; return end end
%calculate Resistance Dfs=[[]]; Mbh=[[]]; Rbh=[]; Mdf=[]; EPbh=[]; Vstep=0.2; taumin=2; j=0; for tau=taumin:5 %tau: 2<=tau<=24 % if i>2 % tau=taux(i); % end %volumetric Froude: %Fn=Vs/(g*m^(1/3))^0.5; %normal Froude: Fn=Vs/sqrt(g*L); if ignoreBoundaries==0 if Fn>1.5||tau<2||tau>24 %schauen ob Grenzen eingehalten resistance=0; power=0; tau0=0; return end end Cv=Vs/sqrt(g*b); %1 if ignoreBoundaries==0 if Cv>25||Cv<0.6 %schauen ob Grenzen eingehalten resistance=0; power=0; tau0=0; return end end %if Cv<25&&Cv>0.6 %step 2: Clbeta=(m*g)/(0.5*rho*Vs^2*b^2); %2