Solving a Differential Equation Numerically

3 vues (au cours des 30 derniers jours)
Aditya Goel
Aditya Goel le 1 Juil 2021
Commenté : Aditya Goel le 18 Juil 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 commentaires
Alan Stevens
Alan Stevens le 2 Juil 2021
Upload your actual Matlab file.
Aditya Goel
Aditya Goel le 18 Juil 2021
I approached the modelling a different way, thank you

Connectez-vous pour commenter.

Réponses (0)

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by