Matlab code to solve an integral
이전 댓글 표시
Hello! I need some help with Matlab.
I would like to solve and plot the following function:

I know everything except for W and x. I want to plot x vs. W, and the values of x should go from 0 to 1.
kw = 91371;
Ca0 = 1.81 * 10 ^ -4;
Fa0 = 0.1233;
K = 2;
Thank you in advance.
댓글 수: 1
Walter Roberson
2019년 6월 15일
The value of the expression goes to infinity as x approaches 1, and the integral does as well. The integral is
(4116815215161981957*A)/1525375194746818396160000 - (2711395674095616*log(1 - A))/363677786528305625
답변 (1개)
KALYAN ACHARJYA
2019년 6월 15일
편집: KALYAN ACHARJYA
2019년 6월 15일
#Edited
syms x
kw = 91371;
CaO= 1.81 * 10 ^ -4;
FaO= 0.1233;
K = 2;
fun = (FaO*(1+(K*CaO)*(1-x)))/(kw*CaO*(1-x))
int(fun)
댓글 수: 4
madhan ravi
2019년 6월 15일
편집: madhan ravi
2019년 6월 15일
+1 fplot()ing the result with the range 0-1 would give the desired plot. I suspect Fa0 is common for both numerator and denominator can’t verify as I don’t have PC to verify. The first paranthesis "(" should be after the first asterisk , I suppose.
KALYAN ACHARJYA
2019년 6월 15일
편집: KALYAN ACHARJYA
2019년 6월 15일
syms x
kw = 91371;
CaO= 1.81 * 10 ^ -4;
FaO= 0.1233;
K = 2;
fun = (FaO*(1+(K*CaO)*(1-x)))/(kw*CaO*(1-x))
in=int(fun)
fplot(in,[0 1])
I suspect Fa0 is common for both numerator and denominator, @Madhan I am not sure.
Walter Roberson
2019년 6월 15일
This is incorrect code. The 1+ K*Ca0 is not being multiplied by (1-x) in the original formula: it is 1 + (K*Ca0)*(1-x) .
KALYAN ACHARJYA
2019년 6월 15일
@Walter Yes, Edited Thanks sir
카테고리
도움말 센터 및 File Exchange에서 Numeric Solvers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!