How do you integrate a very long equation on MATLAB?

6 views (last 30 days)
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 = 

Answers (2)

David Hill
David Hill on 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 on 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
.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!