www.pudn.com > ship.zip > f.m, change:2016-08-31,size:830b


function dy = f(t,x,fcn_delta,duo,luoxuanjiang) 
global L Lw B d Cwa Cp Cb m Iz rou V n Dp Cpp  H wp wr P AR Xuu Xvr Xvv Xrr Yv  Yvr Yvv Yrr Yvrr Yvvr Nv  Nr Nvv Nvvr Nvrr m mx my Jz Iz 
x = x(:); 
u = x(1); 
v = x(2); 
r = x(3); 
delta = fcn_delta(t,x); 
X = [u,v,r,delta]; 
F = luoxuanjiang(X); 
Xp = F(1); 
Yp = F(2); 
Np = F(3);  
F = duo(X); 
Xr = F(1); 
Yr = F(2); 
Nr = F(3);  
dy = x; 
 
% dy(1) = ((m+my)*r*v+Xuu*u^2+Xvv*v^2+Xvr*v*r+Xrr*r^2+Xp+Xr)/(m+mx); 
% dy(2) = ((m+mx)*r*u+Yv*v+Yr*r+Yvv*abs(v)*v+Yvr*abs(v)*r+Yrr*abs(r)*r+Yp+Yr)/(m+my); 
% dy(3) = (Nv*v+Nr*r+Nvv*abs(v)*v+Nvvr*v^2*r+Nvrr*v*r^2+Np+Nr)/(Iz+Jz); 
 
dy(1) = ((m+my)*r*v+Xuu*u^2+Xvv*v^2+Xvr*v*r+Xrr*r^2+Xp+Xr)/(m+mx); 
dy(2) = ((m+mx)*r*u+Yv*v+Yr*r+Yvv*v*v+Yvr*v*r+Yrr*r*r+Yp+Yr)/(m+my); 
dy(3) = (Nv*v+Nr*r+Nvv*v*v+Nvvr*v^2*r+Nvrr*v*r^2+Np+Nr)/(Iz+Jz);