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!