First Order solving ODE and simulink
2 views (last 30 days)
Divija Aleti on 22 Apr 2021
Firstly, as you are defining all the variables inside the function, you do not need to pass them as the function's arguments.
Secondly, you are getting an error as you did not define the variable 'C' in your code. Have a look at the following code.
function dCdt = F_O()
t = 300;
Ce = 100;
C = 1; % Define the variable 'C' by giving it some value. As an example I gave C=1.
kLa = 0.0285;
dCdt = (kLa*Ce-C)/t;
Hope this helps!