Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the program in c. Write a program that can calculate the arc length of a curve. For any function f, the arc length of

image text in transcribedWrite the program in c.

Write a program that can calculate the arc length of a curve. For any function f, the arc length of the curve between points (a, f(a) and (b, f (b) is defined as V1(f(x))2dx where f(x) is the derivative of f(x) If you haven't taken Calculus 2, a definite integral is defined as follows g(x)dx G(b) - G(a) dG where G is the antiderivative of g-ie. g = If the function g is simple, it's possible to find the antiderivative. However, for the arc length, the function g (x)-V1 + (x 2, is not simple, and it is very difficult to find the antiderivative dx In this case, we can use the following approximation i=N- (a + ian + g(a + (i + 1) x) g(x)dx = Ax ges from a to b-a g(x)+g(x+Ax) Where This is equivalent to summing up b in steps of Ax. Since, we want to find the arc length of f(x), we substitute g(x) - Ax ) as goes from a to Running the program Your program should take 4 arguments: function a b deltax where function is 1, 2, or 3. If unction is 1, f(r) x. If function is 2, f(x) I function is 3, f(x) V1-2) So, to calculate the length of the ex curve from 0 to 1 with -0.0001, you should run the program as follows $./arclen 2 01 0.0001 arcen value = 2.003787 The exact values that you get may be off a little bit, depending on how you calculate the functions To calculate the length of the V1- x2 curve from 0 to do the following $ ./arclen 3 0 0.707107 0.0001 arclen value-0.785530 Write a program that can calculate the arc length of a curve. For any function f, the arc length of the curve between points (a, f(a) and (b, f (b) is defined as V1(f(x))2dx where f(x) is the derivative of f(x) If you haven't taken Calculus 2, a definite integral is defined as follows g(x)dx G(b) - G(a) dG where G is the antiderivative of g-ie. g = If the function g is simple, it's possible to find the antiderivative. However, for the arc length, the function g (x)-V1 + (x 2, is not simple, and it is very difficult to find the antiderivative dx In this case, we can use the following approximation i=N- (a + ian + g(a + (i + 1) x) g(x)dx = Ax ges from a to b-a g(x)+g(x+Ax) Where This is equivalent to summing up b in steps of Ax. Since, we want to find the arc length of f(x), we substitute g(x) - Ax ) as goes from a to Running the program Your program should take 4 arguments: function a b deltax where function is 1, 2, or 3. If unction is 1, f(r) x. If function is 2, f(x) I function is 3, f(x) V1-2) So, to calculate the length of the ex curve from 0 to 1 with -0.0001, you should run the program as follows $./arclen 2 01 0.0001 arcen value = 2.003787 The exact values that you get may be off a little bit, depending on how you calculate the functions To calculate the length of the V1- x2 curve from 0 to do the following $ ./arclen 3 0 0.707107 0.0001 arclen value-0.785530

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions