How do you initialize a nested function?
Mostra commenti meno recenti
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 Commenti
Jan
il 31 Gen 2018
What do you mean by "initialize"? What exactly does "the parent function is initialized in a separate .m file" mean?
Moyin
il 31 Gen 2018
Modificato: Walter Roberson
il 31 Gen 2018
Walter Roberson
il 31 Gen 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
il 31 Gen 2018
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Programming in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!