Solving a Differential Equation Numerically

3 visualizzazioni (ultimi 30 giorni)
Aditya Goel
Aditya Goel il 1 Lug 2021
Commentato: Aditya Goel il 18 Lug 2021
I have the following differential equation:
pch4=@(x,w)a*(1-x)*((1-(alpha*w))^0.5);
ph2O=@(x,w)a*(b-x)*((1-(alpha*w))^0.5);
pO2=@(x,w)a*(c-x)*((1-(alpha*w))^0.5);
ra1=@(x,w)(k1.*k2.*pch4(x,w).*pO2(x,w)./((k1.*pO2(x,w)*(1+(Kp.*ph2O(x,w))))+(2.*k2.*pch4(x,w))+(k1.*k2.*pch4(x,w).*pO2(x,w)./k3)))
ode= diff(x,w)==-ra1(x,w)/F;
where, a,b,c k1,k2,k3,Kp, F are known parameters.
I was wondering how to solve it numerically, since I get the following error while using ode45:
Mixture of single and double data for 't0', 'y0', and 'f(t0,y0)' in call to
ode45.
> In odearguments (line 119)
In ode45 (line 115)
  2 Commenti
Alan Stevens
Alan Stevens il 2 Lug 2021
Upload your actual Matlab file.
Aditya Goel
Aditya Goel il 18 Lug 2021
I approached the modelling a different way, thank you

Accedi per commentare.

Risposte (0)

Prodotti


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by