How do you initialize a nested function?
古いコメントを表示
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 件のコメント
Jan
2018 年 1 月 31 日
What do you mean by "initialize"? What exactly does "the parent function is initialized in a separate .m file" mean?
Moyin
2018 年 1 月 31 日
編集済み: Walter Roberson
2018 年 1 月 31 日
Walter Roberson
2018 年 1 月 31 日
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
2018 年 1 月 31 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!