Trying to solve a definite integral but wont give numerical solution

조회 수: 1 (최근 30일)
  1. Q=150;
  2. k=1.49;
  3. n=0.02;
  4. So=0.0048;
  5. b=3;
  6. g=32.2;
  7. x1=0;
  8. y1=3; %x2=200;
  9. h=20;
  10. x2=200;
  11. syms y;
  12. f_xy=(So-((Q*n)/(k*b*(y^(5/3))))^2)/(1-((Q^2)/((b^2)*g*y^3)));
  13. func=int(f_xy,y,[x1 x2]);
  14. vfunc=vpa(func);
  15. y=y1+vfunc;
  16. ys=string(y);
  17. yf=str2double(ys);
this is what shows up in the varaibles for ys= "int((10000/(22201*y^(10/3)) - 3/625)/(12500/(161*y^3) - 1), y, 0, 200) + 3"
Also the above equation is not how it should look with variables plugged in.

채택된 답변

Torsten
Torsten 2019년 8월 23일
Q=150;
k=1.49;
n=0.02;
So=0.0048;
b=3;
g=32.2;
x1=0;
y1=3; %x2=200;
h=20;
x2=200;
f_xy=@(y)(So-((Q*n)./(k*b*(y.^(5/3)))).^2)./(1-((Q^2)./((b^2)*g*y.^3)));
vfunc=integral(f_xy,x1,x2);
y=y1+vfunc
  댓글 수: 7
Torsten
Torsten 2019년 8월 23일
편집: Torsten 2019년 8월 23일
Q=150;
k=1.49;
n=0.02;
So=0.0048;
b=3;
g=32.2;
x1=0;
y1=3; %x2=200;
h=20;
x2=[20,40,60];
f_xy=@(y)(So-((Q*n)./(k*b*(y.^(5/3)))).^2)./(1-((Q^2)./((b^2)*g*y.^3)));
vfunc = zeros(numel(x2,1));
for i=1:numel(x2)
vfunc(i) = integral(f_xy,x1,x2(i));
end
y = y1+vfunc
But - as already said - you should check whether the integral exists at all.
Heather Holzer
Heather Holzer 2019년 8월 23일
I will. Thank you so so very much for your excellence!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by