jonathf/matlab2cpp

d0 notation

Closed this issue · 1 comments

Följande fil fungerar inte p.g.a. "d0"

function set_vel_SN = vt_ufm_baseline(diameter,rho_prop,rho_fl,K_prime,n_prime)

      set_vel_SN = (1/(3.^(n_prime-1)*18)*(rho_prop-rho_fl)/K_prime*9.81*diameter.^(n_prime+1)).^(1/n_prime);

     set_vel_previous = 0;

      A = 0.15d0*(3d0.^(n_prime-1)*diameter.^n_prime/K_prime*rho_fl).^(2d0/3d0);
      B = 3d0.^(n_prime-1)*diameter.^(n_prime+1)/K_prime*(rho_prop-rho_fl)*9.81d0/18d0;
      C = 1d0/3d0*(4d0+n_prime);
      D = 1d0/3d0*(1+n_prime);

      N = 0;

      while ((abs(set_vel_SN- set_vel_previous)>1e-6) && (N<1000))        
          N = N+1;
          Z = set_vel_SN.^(n_prime);
          X = A*set_vel_SN.^(C);
          F_SN_prime = n_prime*Z/set_vel_SN  + C*X/set_vel_SN;
          F_SN = Z + X - B;
          set_vel_previous = set_vel_SN;
          set_vel_SN = max(set_vel_SN - 0.9d0*F_SN/F_SN_prime,0.001d0*set_vel_SN);

      end

end

Supported now.