How do you integrate a very long equation on MATLAB?

6 Ansichten (letzte 30 Tage)
JingChong Ning
JingChong Ning am 9 Sep. 2022
Beantwortet: Star Strider am 9 Sep. 2022
I have a very long equation (yuse*p) that I need to integrate over. However, as you can see, the code is not returning my values, just regurgitate whatever I input in it. Could you guys help me find a way to integrate it?
syms x
y = 0.5+x^0.6532;
%incremental surface
yuse = sqrt(1+(diff(y))^2);
%pressure along the nozzle wall
p = 7.593*x^6 - 231*x^5 + 2316.1*x^4 - 10644*x^3 + 21966*x^2 - 16304*x + 1000000;
%integrate
int(yuse*p,0,10)
ans = 

Antworten (2)

David Hill
David Hill am 9 Sep. 2022
Numerical integration.
p=@(x)(7.593*x.^6 - 231*x.^5 + 2316.1*x.^4 - 10644*x.^3 + 21966*x.^2 - 16304*x + 1000000).*...
sqrt(1+2666689./(6250000*x.^(867/1250)));
I=integral(p,0,10)
I = 9.6221e+06

Star Strider
Star Strider am 9 Sep. 2022
Use the vpaintegral function —
syms x
y = 0.5+x^0.6532;
%incremental surface
yuse = sqrt(1+(diff(y))^2);
%pressure along the nozzle wall
p = 7.593*x^6 - 231*x^5 + 2316.1*x^4 - 10644*x^3 + 21966*x^2 - 16304*x + 1000000;
%integrate
Value = vpaintegral(yuse*p,0,10)
Value = 
9622050.0
.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by