Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Julia Language 1. Write a function to integrate a fiunction funx) from A to B using the trapezoidal rule. Your function should have 3

image text in transcribed
Using Julia Language 1. Write a function to integrate a fiunction "funx)" from A to B using the trapezoidal rule. Your function should have 3 number of interval) so we want.... arguments: A, B and N (the for the function use fun(x) but this should also be written as a function .. .not imbedded in your quadriture function so like: function funx) (x-sin(x^3)-exp(-0.01 *x))/(x+exp(0.01%)) end Then use the function in your quadrature function. (recall h = (BA)/N) 2. Write a program which prompts the user to enter A, B and N. You may assume the user will enter numbers, but you should check to see that N is an integer. A and B can be either integers or real numbers. Your program should then print out The integral of fun(x) from A to B using N intervals is xxxx (obviously print out the values A,B and N not "A" "B" and "N1 3. As a test case use A = 0, B = 10 and N-100. Report that result. Just for your edification, also try N -10 and N- 1000 to see how the accuracy varies Using Julia Language 1. Write a function to integrate a fiunction "funx)" from A to B using the trapezoidal rule. Your function should have 3 number of interval) so we want.... arguments: A, B and N (the for the function use fun(x) but this should also be written as a function .. .not imbedded in your quadriture function so like: function funx) (x-sin(x^3)-exp(-0.01 *x))/(x+exp(0.01%)) end Then use the function in your quadrature function. (recall h = (BA)/N) 2. Write a program which prompts the user to enter A, B and N. You may assume the user will enter numbers, but you should check to see that N is an integer. A and B can be either integers or real numbers. Your program should then print out The integral of fun(x) from A to B using N intervals is xxxx (obviously print out the values A,B and N not "A" "B" and "N1 3. As a test case use A = 0, B = 10 and N-100. Report that result. Just for your edification, also try N -10 and N- 1000 to see how the accuracy varies

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

Explain the relationship between NPV and a firms value.

Answered: 1 week ago

Question

Explain what is meant by the terms unitarism and pluralism.

Answered: 1 week ago