Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Matlab program to do Gauss Legendre Quadrature Integration using the following approach. Program Input The program will read a three line input file,

Write a Matlab program to do Gauss Legendre Quadrature Integration using the following approach.

image text in transcribed

Program Input The program will read a three line input file, with comma separated values Line 1 - number of elements, global X location of the starting (leftmost) point, number of output points Line 2-list of the lengths of the elements (# of values should match line l 1st entry) . Line 3-6 values as coefficients for the polynomial being studied, resulting in a function of the form f(x)-C+C-xHG.x2HG.x'HG.x4 +G.x Program Output Output can be written directly or to a file. It does not need elaborate formatting, but should be readable For the first part, there should be an output line for each point (1 ine, 3 value). It will contain that number of equally spaced output points from the far left (1st line, 2ad value) to the right of the last element. For each point, list: Global X location, the element number it belongs to, the location in natural coordinates, and the value of fx) at this location. For the secod part categral of the polynomial fuaction over the lengrh of each element and print this value. Optionally, they can be summed for an integral over the entire range. Use three integration points (it is not necessary to compare using one and two integration points as originally described). Compare this to the exact solution. The exact solution can be part of the program or done separately. Program Input The program will read a three line input file, with comma separated values Line 1 - number of elements, global X location of the starting (leftmost) point, number of output points Line 2-list of the lengths of the elements (# of values should match line l 1st entry) . Line 3-6 values as coefficients for the polynomial being studied, resulting in a function of the form f(x)-C+C-xHG.x2HG.x'HG.x4 +G.x Program Output Output can be written directly or to a file. It does not need elaborate formatting, but should be readable For the first part, there should be an output line for each point (1 ine, 3 value). It will contain that number of equally spaced output points from the far left (1st line, 2ad value) to the right of the last element. For each point, list: Global X location, the element number it belongs to, the location in natural coordinates, and the value of fx) at this location. For the secod part categral of the polynomial fuaction over the lengrh of each element and print this value. Optionally, they can be summed for an integral over the entire range. Use three integration points (it is not necessary to compare using one and two integration points as originally described). Compare this to the exact solution. The exact solution can be part of the program or done separately

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

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

=+4. What might explain any differences that you identify?

Answered: 1 week ago

Question

=+2. Is there a strong collective bargaining culture in evidence?

Answered: 1 week ago