function v=compute_ekman_surge_bet(vmax,rmax,r35,vt,phi,phi_in,w,a,n,lat)
% Computes ekman_surge_bet
% Script automatically generated by fit_ekman_surge_bet.m
% Inputs : 
% vmax           = Vmax (km/h)
% rmax           = Rmax (km)
% r35            = R35 (km)
% vt             = forward speed (km/h)
% phi            = track angle (deg)
% phi_in         = inflow angle (deg)
% w              = shelf width (km)
% a              = Dean slope a (-)
% n              = Mannings n
% lat            = latitude (deg)

% R2    = 0.70449
% RMSE  = 1.1588
% MEAN  = 1.118
% RANGE = -4 - 4.6667

beta( 1 )= -1.1570e+00 ;
beta( 2 )= 7.0934e+01 ;
beta( 3 )= 8.8634e-02 ;
beta( 4 )= -3.2696e-02 ;
beta( 5 )= 2.0877e+00 ;
beta( 6 )= 1.1160e+01 ;
beta( 7 )= 4.2712e+01 ;
beta( 8 )= 2.4223e+01 ;
beta( 9 )= 8.7255e+00 ;
beta( 10 )= 9.9575e+01 ;
beta( 11 )= -6.2243e+01 ;
beta( 12 )= -1.1160e-02 ;
beta( 13 )= 3.8907e-03 ;
beta( 14 )= 4.1132e-02 ;

v=beta(1) + beta(2)*a + beta(4)*lat + beta(5)*cos(phi*pi/180) + beta(3)*w.*sin((min(phi,beta(8))-beta(7))*pi/180).*exp(-vt.*cos((phi)*pi/180)/beta(6)) + beta(9)*(exp(-vmax/beta(10))) + beta(11)*n + beta(12)*rmax + beta(13)*r35 + beta(14).*phi_in;
