How to plot an integral
116 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Marina Gonzalez
le 15 Juin 2019
Réponse apportée : Star Strider
le 15 Juin 2019
Hello!
I need some help plotting the following:
![kjb.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/224695/kjb.png)
This is what I have:
syms x
kw = 91371;
CaO= 1.81*10^(-4);
FaO= 0.1233;
K = 1.29;
fun =FaO*((1+K*CaO*(1-x))/(kw*CaO*(1-x)))
W=int(fun);
fplot(W,[0 1
But nothing comes out on the graph. I want to plot W on the Y-axis and x on the X-axis, between 0 and 1 (because it's a conversion in chemistry).
Does anyone know what I'm doing wrong?
5 commentaires
Walter Roberson
le 15 Juin 2019
In this calculation W is imaginary below 2.0007245246191665436401515314702
Réponse acceptée
Star Strider
le 15 Juin 2019
‘But nothing comes out on the graph.’
The result of the int function is a constant. At best, you will get a straight line.
I am not certain what you want. You can get it to plot as a function of the upper limit of integration by creating a function from it:
syms x a
kw = 91371;
CaO= 1.81*10^(-4);
FaO= 0.1233;
K = 1.29;
fun = FaO*((1+K*CaO*(1-x))/(kw*CaO*(1-x)));
W(a) = int(fun, x, 0, a);
fplot(W,[0 1])
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Line Plots 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!