Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise M8 Consider the following ratio of two polynomials in x: R(x)= N(x) D(x) = 2+3x +4x2 (x 1)(x 2)(x 3) When functions of this

image text in transcribed

Exercise M8 Consider the following ratio of two polynomials in x: R(x)= N(x) D(x) = 2+3x +4x2 (x 1)(x 2)(x 3) When functions of this form are inside an integral, it is impossible to evaluate the integral analytically without changing the form. With the method of partial fraction expansion, we can rewrite this ratio as a sum of simpler terms: R(x)= R1(x)+R2(x)+R3(x)= c1 x 1 + c2 x 2 + c3 x 3 which puts the function into a form that can be used in the integral. You will write a script to find the three coefficients, c1, c2, and c3. Then you will check your answer and study some peculiarities of the checking process. In particular, sometimes the check works and sometimes it doesnt. It will be your job to find out why. DESIGN SPECIFICATIONS 1. Build an efficient script to compute c1, c2, and c3 using matrix operations. 2. Compute R(x) in its given form, then compute R1(x), R2(x), and R3(x), all from x = 4 to x = 4, checking to make sure R(x) = R1(x) + R2(x) + R3(x), point by point. 3. Let n = the number of points in your x array, and make n a user-defined variable. Try different values of n, finding some that work and some that dont. Explain. To solve for the coefficients, multiply both sides of the equation by the denominator D(x), then collect terms of the same power of x on the right side, i.e., constant terms, linear terms, and quadratic terms. In order for the left side to be equal to the right side for every value of x, the constant term on the left must be equal to the sum of the constant terms on the right. This is your first equation. Similarly, the linear term on the left must be equal to the sum of linear terms on the right, and the quadratic term on the left must be equal to the sum of quadratic terms on the right. These are your second and third equations. With three equations each having three unknowns, you can set up a matrix equation and solve for the unknowns relatively easily. To compute the functions needed for Spec #2, it is useful to define three denominators, e.g., D1(x) = x 1, then use them to build all four functions. To check that R(x) = R1(x) + R2(x) + R3(x), construct a function that should be an array of very small numbers, then sum their absolute values. If the function is an array of very small numbers, this sum should also be very small. Depending on what value of n you choose initially, this check might not work as expected. Therefore, use n = INPUT(prompt) to allow you to easily change the number of points in your arrays. You should be able to find some that work and some that dont. Explain why some work and some dont. It might help to plot the functions, though this is not required, and you should not include any figures in your solution. Output the Command Window showing 10 or more cases. You may hardwire everything but the number of points in array x.

Consider the following ratio of two polynomials inx: N(x)2+3x +4x D(x) (x-1) (x-2)(x-3) When functions of this form are inside an integral, it is impossible to evaluate the integral analytically without changing the form. With the method of partial fraction expansion, we can rewrite this ratio as a sum of simpler terms R(x)-R(x)+R2(x)+Rx) x-1 x-2 x-3 which puts the function into a form that can be used in the integral. You will write a script to find the three coefficients, c,, cz, and c3. Then you will check your answer and study some peculiarities of the checking process. In particular, sometimes the check works and sometimes it doesn't. It will be your job to find out why DESIGN SPECIFICATIONS 1. Build an efficient script to compute c, c2, and c, using matrix operations. 2. Compute R(x) in its given form, then compute R1(x), R2(x), and R3(x), all from x =-4 to x = 4, checking to make sure R(x) = R1(x)-R-()-R3(x), point by point. 3. Let n- the number of points in yourx array, and make n a user-defined variable. Try different values of n, finding some that work and some that don't. Explain. To solve for the coefficients, multiply both sides of the equation by the denominator D(x), then collect terms of the same power ofx on the right side, i.e., constant terms, linear terms, and quadratic terms. In order for the left side to be equal to the right side for every value ofx, the constant term on the left must be equal to the sum of the constant terms on the right. This is your first equation. Similarly, the linear term on the left must be equal to the sum of linear terms on the right, and the quadratic term on the left must be equal to the sum of quadratic terms on the right. These are your second and third equations. With three equations each having three unknowns, you can set up a matrix equation and solve for the unknowns relatively easily. To compute the functions needed for Spec #2, it is useful to define three denominators, eg D,(x)-x-1, then use them to build all four functions. To check that R(x) R,x)+ R,(x) + R(x) construct a function that should be an array of very small numbers, then sum their absolute values. If the function is an array of very small numbers, this sum should also be very small Depending on what value of n you choose initially, this check might not work as expected. Therefore, use n = INPUT (prompt ) to allow you to easily change the number of points in your arrays. You should be able to find some that work and some that don't. Explain why some work and some don't. It might help to plot the functions, though this is not required, and you should not include any figures in your solution. Output the Command Window showing 10 or more cases You may "hardwire" everything but the number of points in array x. Consider the following ratio of two polynomials inx: N(x)2+3x +4x D(x) (x-1) (x-2)(x-3) When functions of this form are inside an integral, it is impossible to evaluate the integral analytically without changing the form. With the method of partial fraction expansion, we can rewrite this ratio as a sum of simpler terms R(x)-R(x)+R2(x)+Rx) x-1 x-2 x-3 which puts the function into a form that can be used in the integral. You will write a script to find the three coefficients, c,, cz, and c3. Then you will check your answer and study some peculiarities of the checking process. In particular, sometimes the check works and sometimes it doesn't. It will be your job to find out why DESIGN SPECIFICATIONS 1. Build an efficient script to compute c, c2, and c, using matrix operations. 2. Compute R(x) in its given form, then compute R1(x), R2(x), and R3(x), all from x =-4 to x = 4, checking to make sure R(x) = R1(x)-R-()-R3(x), point by point. 3. Let n- the number of points in yourx array, and make n a user-defined variable. Try different values of n, finding some that work and some that don't. Explain. To solve for the coefficients, multiply both sides of the equation by the denominator D(x), then collect terms of the same power ofx on the right side, i.e., constant terms, linear terms, and quadratic terms. In order for the left side to be equal to the right side for every value ofx, the constant term on the left must be equal to the sum of the constant terms on the right. This is your first equation. Similarly, the linear term on the left must be equal to the sum of linear terms on the right, and the quadratic term on the left must be equal to the sum of quadratic terms on the right. These are your second and third equations. With three equations each having three unknowns, you can set up a matrix equation and solve for the unknowns relatively easily. To compute the functions needed for Spec #2, it is useful to define three denominators, eg D,(x)-x-1, then use them to build all four functions. To check that R(x) R,x)+ R,(x) + R(x) construct a function that should be an array of very small numbers, then sum their absolute values. If the function is an array of very small numbers, this sum should also be very small Depending on what value of n you choose initially, this check might not work as expected. Therefore, use n = INPUT (prompt ) to allow you to easily change the number of points in your arrays. You should be able to find some that work and some that don't. Explain why some work and some don't. It might help to plot the functions, though this is not required, and you should not include any figures in your solution. Output the Command Window showing 10 or more cases You may "hardwire" everything but the number of points in array x

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions