Borrar filtros
Borrar filtros

How do you integrate a very long equation on MATLAB?

2 visualizaciones (últimos 30 días)
JingChong Ning
JingChong Ning el 9 de Sept. de 2022
Respondida: Star Strider el 9 de Sept. de 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 = 

Respuestas (2)

David Hill
David Hill el 9 de Sept. de 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 el 9 de Sept. de 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
.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by