Calculation of Arc length of grade 2 and grade 4 polynomial function
4 views (last 30 days)
Show older comments
Hello,
I am a new user of Matlab with no experience, but I try to analyse some of the data of a research project using it. The task is to calculate the arc length of a detected surface over the time. The surface at the beginning has the shape of a squared function, after a certain period of time a deformation starts and the surface is following a polynomial function 4th grade. I tried to solve the problem with Excel but I can not integrate the square root of a 4th-grade function. Some research on the internet showed that this would be possible with Matlab, but unfortunately, I can not find a solution by myself.
I am very thankful for any idea! Thank you in advance.
0 Comments
Accepted Answer
Star Strider
on 3 Oct 2015
Edited: Star Strider
on 3 Oct 2015
t = linspace(-1, 1); % Create Data
dt = t(2)-t(1);
x = t.^3;
y = t.^5;
dx = gradient(x,dt); % Derivatives
dy = gradient(y,dt);
ds = hypot(dx, dy); % Arc Segment Vector
cum_arclen = cumtrapz(t, ds); % Cumulative Integration
tot_arclen = cum_arclen(end); % Total Arc Length (Equivalent To Using ‘trapz’)
figure(1)
plot(x,y, x,cum_arclen)
grid
axis equal
legend('Original Data', 'Arc Length', 'Location','NW')
EDIT — Added ‘example’ code.
11 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!