Why am I getting Error using nargin? Tried to run the below code but only getting the error using nargin. I attempted everything

조회 수: 3 (최근 30일)
%% SEDIMENTATION INTERFACE
function dh_s = Emul(t,h)
nd = 1000; % No. of Droplets
% D = 300; % Droplets Diameter of Sphere in microns
Vol = 900; % Liquid volume of emulsion (ml)
l = 0.5; % Mean Distance between droplets
alpha = 0.08; % Empirical Collision Effiency Parameter
D0 = 300; % Initial Droplet Diameter (microns)
Pr = 0.74; % Volume Fraction
Pr0 = ((nd*pi*D0^3)/6)/Vol; % Initial Volume Fraction of droplet
Prm = ((nd*pi*((D0+l)^3))/6)/Vol; % Maximum Volume Fraction of droplet
delrho = rho_B1 - rho_O1; % difference between the dispersed water and continuous oil phase
Vsto = (delrho*g*(D0^2))/18*mu1; % Settling Velocity of Hard Spheres (stoke's velocity)
fPr = (1-Pr0)^5.3; % Dimensionless
%D = sqrt((2/3)*alpha*((Vsto*fPr)/(((Prm/Pr0)^1/3)-1))*(D0*t)+(D0^2)); % evolution of average diameter versus time
K1 = ((2/3)*alpha*((Vsto^2)/D))*((fPr^2)/((Prm/Pr)^1/3)-1);
dh_s = -K1*t-(Vsto*fPr);
Command Window Code and results:
Any assistance is greatly appreciated.

채택된 답변

Davide Masiello
Davide Masiello 2022년 2월 5일
When you call ode45, you shold use the function's name (i.e. Emul).
In the example above you are inputting 'Emulsion', which is probably the name of a another script you have samed in your current folder.
Just write
[t,h] = ode45('Emul',t,h0);
  댓글 수: 4

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by