How do you initialize a nested function?
Mostrar comentarios más antiguos
Hello everyone,
I'm trying to find the derivative of qi with respect to time and I'm not sure how to initialise qi. The ode function is nested within a parent function (and the parent function is initialised in a separate .m file). Is there a format for initializing nested odes?
A copy of the nested function is shown below:
%Code
function dqidt= LDF1(~,qi)
%This function computes the derivative of qi wrt time
TestProcess_Parameters;
qistar = qsat* bi*P_opt^vi/(1+ bi*P_opt*vi); %Calculate Equilibrium molar loading
k =(15*Dm)/Rc^2; %Mass transfer coefficient for spherical adsorbent pellets
dqidt = k*(qistar - qi);
end
4 comentarios
Jan
el 31 de En. de 2018
What do you mean by "initialize"? What exactly does "the parent function is initialized in a separate .m file" mean?
Moyin
el 31 de En. de 2018
Editada: Walter Roberson
el 31 de En. de 2018
Walter Roberson
el 31 de En. de 2018
You are calling LDF with one parameter, but you are defining LDF with two parameters in which you are ignoring the first. Since you have exclusive control over LDF, it would not seem to make sense to define it as taking two parameters.
Moyin
el 31 de En. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!