You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: forwarddynamics2.m
    path of file: ./repos/AUVForwardDynamics
    
    the code of the file until where you have to start completion: %  Forward Dynamics Model NPS AUV II (Healy and Lienhard 1993)
% * Advisor : Prof Vishwanath Nagarajan
% * Department of Ocean Engineering and Naval Architecture, *IIT Kharagpur*
% * *Autonomous Underwater Vehicle Team, IIT Kharagpur*
%
% function dX = forwarddynamics2(t, X) 
% Function containing 6DOF equations of bot, global coordinates, euler
% angles and control surface deflections in the form (A)(dX)=C;
% 
% t : time array specifying the time instants for which the equations have to
%     be solved
% X : 18X1 state vector
%     u = X(1);
%     v = X(2);
%     w = X(3);
%     p = X(4);
%     q = X(5);
%     r = X(6);
%     pos_x=X(7);  Global X coordinate 
%     pos_y=X(8);  Global Y coordinate 
%     pos_z=X(9);  Global Z coordinate 
%     phi = X(10);
%     theta =X(11);
%     psi = X(12);
%     Del_s = X(13);  %stern deflection
%     Del_bp =X(14);  %port bow deflection
%     Del_bs =X(15);  %starboard bow deflection
%     Del_r = X(16);  %rudder deflection
%     Del_delb = X(17);%change in buoyancy
%     n = X(18); % propeller RPM

% INPUT:time t
%       array X at t=0
%       ord_defl
%       caseNo
%       D : external disturbance vector
% ord_defl(1)=del_ordered_rudder
% ord_defl(2)=del_ordered_stern
% ord_defl(3)=del_ordered_bp
% ord_defl(4)=del_ordered_bs
% ord_defl(5)=propellor RPS;
% OUTPUT:dX
% function dX = forwarddynamics2(t, X)             




function dX = forwarddynamics2(t
    
function dX = forwarddynamics2(t, X) 
% Function containing 6DOF equations of bot, global coordinates, euler
% angles and control surface deflections in the form (A)(dX)=C;
% 
% t : time array specifying the time instants for which the equations have to
%     be solved
% X : 18X1 state vector
%     u = X(1);
%     v = X(2);
%     w = X(3);
%     p = X(4);
%     q = X(5);
%     r = X(6);
%     pos_x=X(7);  Global X coordinate 
%     pos_y=X(8);  Global Y coordinate 
%     pos_z=X(9);  Global Z coordinate 
%     phi = X(10);
%     theta =X(11);
%     psi = X(12);
%     Del_s = X(13);  %stern deflection
%     Del_bp =X(14);  %port bow deflection
%     Del_bs =X(15);  %starboard bow deflection
%     Del_r = X(16);  %rudder deflection
%     Del_delb = X(17);%change in buoyancy
%     n = X(18); % propeller RPM

% INPUT:time t
%       array X at t=0
%       ord_defl
%       caseNo
%       D : external disturbance vector
% ord_defl(1)=del_ordered_rudder
% ord_defl(2)=del_ordered_stern
% ord_defl(3)=del_ordered_bp
% ord_defl(4)=del_ordered_bs
% ord_defl(5)=propellor RPS;
% OUTPUT:dX
% function dX = forwarddynamics2(t, X)             




function dX = forwarddynamics2(t, X, ord_defl, caseNo, D)              


addpath('actuator dynamics');
addpath('utils');
addpath('PDcontrol/divingControl');
addpath('PDcontrol/heavePitchControl');
addpath('PDcontrol/steeringControl');

% Files containing bot properties
geoprop;
control_surf_param;
surgederivatives;
swayderivatives;
heavederivatives;
rollderivatives;
pitchderivatives;
yawderivatives;

d2r = pi/180;

if strcmp(caseNo,'16')==1
    %Heel = 2.5*0.1*9.81;
    phi_heel = 2.5*d2r;
end