Code covered by the BSD License
Highlights from
Shark
-
J=rpy2J(rpy)
J=rpy2J(rpy); computes generalised Jacobian matrix which
-
R_eb=rpy2R_eb(rpy)
R_eb=rpy2R_eb(rpy), computes the rotation matrix of e-frame wrt b-frame,
-
[Cl,Cd,xcp]=a2clcdxc(alfa)
[Cl,Cd,xcp]=a2clcdxc(alfa) computes hydrodynamic coefficients Cl and Cd
-
[v1,v2,v3]=vehicle()
-
a2clcd(alfa)
[Cl, Cd] = a2clcd(alfa) computes hydrodynamic coefficients Cl and Cd
-
demos
DEMOS Demo list for Shark.
-
shark()
(the function shark adds the needed folders to the matlab path)
-
tc=tau_cor(veh,v,vr)
tc=tau_cor(veh,v,vr) calculates coriolis forces from
-
td=tau_damp(veh,vr,de)
td=tau_damp(veh,vr,de); calculates damping forces from
-
tr=tau_rest(veh,p)
tr=tau_rest(veh,p); calculates restoring forces from
-
xdot=vxdot(xu)
computes state derivatives as a function of state and input
-
z=vp(x,y)
-
contents.m
-
linattk.m
-
NLKSF
-
OPLOOP
-
xtrlmod
-
View all files
from
Shark
by Giampiero Campa
Nonlinear 6DOF Model of an Underwater Vehicle
|
| [v1,v2,v3]=vehicle()
|
function [v1,v2,v3]=vehicle()
% [v1,v2,v3]=vehicle;
% creates 3 different vehicle configurations, which vary one
% from another only by the distance between prow and wings.
% -----------------------------------------------------------------------
% configuration # 1
% phisical world variables
v1.g_e=[0; 0; 9.81]; % Gravitational acceleration
v1.rho=1033; % Marine water density
% mass
v1.m=1444.0; % mass (kg)
% Rigid body mass matrix [Kg Kg*m; Kg*m Kg*m^2]
v1.Mrb=[ 1444 0 0 0 252.7 0 ;
0 1444 0 -252.7 0 -2527 ;
0 0 1444 0 2527 0 ;
0 -252.7 0 142.8 0 0 ;
252.7 0 2527 0 2796 0 ;
0 -2527 0 0 0 2778 ];
% Added mass matrix [Kg Kg*m; Kg*m Kg*m^2]
v1.Ma=[ 55.7 0 0 0 0 0 ;
0 1460 0 0 0 -102 ;
0 0 1460 0 102 0 ;
0 0 0 83.4 0 0 ;
0 0 102 0 3401 0 ;
0 -102 0 0 0 3401 ];
% inverse total mass matrix
v1.iM=inv(v1.Mrb+v1.Ma);
% geometric variables
v1.l=3.5; % Fuselage length (m)
v1.d=0.7; % Fuselage diameter (m)
v1.vol=1.39787; % Fuselage volume (m^3)
% vectors
v1.P_b=[0; 0; 0]; % Pole wrt B (m)
v1.G_b=[-1.75; 0; 0.175]; % Center of mass wrt B (m)
v1.B_b=[-1.75; 0; 0]; % Center of buoyancy wrt B (m)
% wings
v1.sw=0.2; % Wing surface (m^2)
v1.cw=0.4; % Wing width (m)
v1.bw=0.5; % Wing length (m)
% Position of wings wrt B along x (m) in config 1
lw=-1.65;
% distance of wing middle point from prow and from axis in config 1
dpfw = -lw +0.25*v1.cw;
dafw = v1.d/2 +0.43*v1.bw;
% wings middle point positions wrt B in config 1
v1.P1_b = [-dpfw; dafw; 0];
v1.P2_b = [-dpfw; 0; dafw];
v1.P3_b = [-dpfw;-dafw; 0];
v1.P4_b = [-dpfw; 0;-dafw];
% tails
v1.st=0.2; % Tail surface (m^2)
v1.ct=0.4; % Tail width (m)
v1.bt=0.5; % Tail length (m)
lt=-3.1; % Position of tails along x wrt B (m)
% distance of tail middle point from prow and from axis
dpft = -lt +0.25*v1.ct;
daft = v1.d/2 +0.43*v1.bt;
% tails middle point positions wrt B
v1.P5_b = [-dpft; daft; 0];
v1.P6_b = [-dpft; 0; daft];
v1.P7_b = [-dpft;-daft; 0];
v1.P8_b = [-dpft; 0;-daft];
% -----------------------------------------------------------------------
% configuration # 2
v2=v1;
% Position of wings wrt B along x (m) in config 2
lw=-1.15;
% distance of wing middle point from prow and from axis in config 2
dpfw = -lw +0.25*v2.cw;
dafw = v2.d/2 +0.43*v2.bw;
% wings middle point positions wrt B in config 2
v2.P1_b = [-dpfw; dafw; 0];
v2.P2_b = [-dpfw; 0; dafw];
v2.P3_b = [-dpfw;-dafw; 0];
v2.P4_b = [-dpfw; 0;-dafw];
% -----------------------------------------------------------------------
% configuration # 3
v3=v1;
% Position of wings wrt B along x (m) in config 3
lw=-0.35;
% distance of wing middle point from prow and from axis in config 3
dpfw = -lw +0.25*v3.cw;
dafw = v3.d/2 +0.43*v3.bw;
% wings middle point positions wrt B in config 2
v3.P1_b = [-dpfw; dafw; 0];
v3.P2_b = [-dpfw; 0; dafw];
v3.P3_b = [-dpfw;-dafw; 0];
v3.P4_b = [-dpfw; 0;-dafw];
|
|
Contact us at files@mathworks.com