Solving a Differential Equation Numerically
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
Réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!