Calculate the area and volume of revolution based on some data points
9 views (last 30 days)
Show older comments
I got the coordinates of an axisymmmetric salt cavern:
x = [0,38.161563,39.751307,40.878082,42.701189,44.524296,45.047229,45.990198,46.933167,46.785121,...
46.225562,41.318857,36.412152,35.7033,36.22748,37.398386,38.569291,39.069331,38.001499,29.200019,...
20.398538,20.034604,19.739322,16.900337,14.061351,13.944131,13.784996,6.892498,0];
y=[-3200.000000,-3185.689414,-3184.723755,-3183.243836,-3179.597622,-3175.951408,-3173.937343,-3152.720547,...
-3131.503752,-3130.054410,-3128.709270,-3120.531428,-3112.353586,-3109.972990,-3107.545039,-3105.203228,...
-3102.861417,-3100.098595,-3097.501874,-3086.500023,-3075.498173,-3074.978887,-3074.417715,-3068.076173,...
-3061.734631,-3061.537271,-3061.371840,-3055.685920,-3050.000000];
plot(x,y)
I would like to calulate the area and volume of revolution of it.
Thanks in advance,
William
0 Comments
Accepted Answer
Torsten
on 4 Oct 2022
Edited: Torsten
on 4 Oct 2022
y = [0,38.161563,39.751307,40.878082,42.701189,44.524296,45.047229,45.990198,46.933167,46.785121,...
46.225562,41.318857,36.412152,35.7033,36.22748,37.398386,38.569291,39.069331,38.001499,29.200019,...
20.398538,20.034604,19.739322,16.900337,14.061351,13.944131,13.784996,6.892498,0];
x=[-3200.000000,-3185.689414,-3184.723755,-3183.243836,-3179.597622,-3175.951408,-3173.937343,-3152.720547,...
-3131.503752,-3130.054410,-3128.709270,-3120.531428,-3112.353586,-3109.972990,-3107.545039,-3105.203228,...
-3102.861417,-3100.098595,-3097.501874,-3086.500023,-3075.498173,-3074.978887,-3074.417715,-3068.076173,...
-3061.734631,-3061.537271,-3061.371840,-3055.685920,-3050.000000];
plot(x,y)
fun = @(xq)interp1(x,y,xq,'spline');
V = pi*integral(@(x)fun(x).^2,x(1),x(end))
3 Comments
Torsten
on 4 Oct 2022
Edited: Torsten
on 4 Oct 2022
How do I get the area of revolution in this example (I'm a starter in matlab) ?
By integrating 2*pi* f(x)*sqrt(1+f'(x)^2) instead of pi*f(x)^2 in the limits x(1) to x(end):
y = [0,38.161563,39.751307,40.878082,42.701189,44.524296,45.047229,45.990198,46.933167,46.785121,...
46.225562,41.318857,36.412152,35.7033,36.22748,37.398386,38.569291,39.069331,38.001499,29.200019,...
20.398538,20.034604,19.739322,16.900337,14.061351,13.944131,13.784996,6.892498,0];
x=[-3200.000000,-3185.689414,-3184.723755,-3183.243836,-3179.597622,-3175.951408,-3173.937343,-3152.720547,...
-3131.503752,-3130.054410,-3128.709270,-3120.531428,-3112.353586,-3109.972990,-3107.545039,-3105.203228,...
-3102.861417,-3100.098595,-3097.501874,-3086.500023,-3075.498173,-3074.978887,-3074.417715,-3068.076173,...
-3061.734631,-3061.537271,-3061.371840,-3055.685920,-3050.000000];
dy = [(y(2)-y(1))/(x(2)-x(1)),(y(3:end)-y(1:end-2))./(x(3:end)-x(1:end-2)),(y(end)-y(end-1))/(x(end)-x(end-1))];
%fun =@(xq) interp1(x,y,xq,'spline').*sqrt(1+interp1(x,dy,xq).^2);
fun =@(xq) interp1(x,y,xq).*sqrt(1+interp1(x,dy,xq).^2);
A = 2*pi*integral(fun,x(1),x(end))
More Answers (0)
See Also
Categories
Find more on Smoothing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!