Question: Please solve in PYTHON!! If you solved this question previously do not answer because the previous answer is incorrect and in different language. 4. Suppose

Please solve in PYTHON!! If you solved this question previously do not answer because the previous answer is incorrect and in different language.

Please solve in PYTHON!! If you solved this question previously do not

answer because the previous answer is incorrect and in different language. 4.

Suppose we wish to solve the boundary-value problem: y4y=0,y(1)=2y(1)=3 One way to

solve this problem is to approximate y(x) as a nth-order Chebyshev polynomia

4. Suppose we wish to solve the boundary-value problem: y4y=0,y(1)=2y(1)=3 One way to solve this problem is to approximate y(x) as a nth-order Chebyshev polynomia p(x). This recasts the problem as p(x)4p(x)=0,p(1)=2p(1)=3 Just like y(x),p(x) is unknown. However, it is uniquely defined by n+1 points. Therefore, we can recast the boundary-value problem as the solution of n+1 equations. Two of the points are given by the boundary conditions. If we assume that the n+1 points are Chebyshev points on the domain [1,1] (e.g. xi=cos(i for i=0,,n.), then the boundary conditions yield the following two equations: p(x0)=2p(xn)=3 The remaining points, in the interior, need to satisy the equations: p(x1)2p(x1)=0p(xn1)2p(xn1)=0 The unknowns are the n+1 coefficients for the polynomials. We also have n+1 equations to solve for the n+1 unknowns. Therefore, we can determine these coefficients using the root command. p(x) is a polynomial of order n-1, whose coefficents are linear combinations of the coefficients of p(x). In the polynomial class within numpy, there is a builtin function for taking the derivatives of the polynomials (similar to your previous homework problem). As an example: p=[1,2,3,4]#T(x)+2T1(x)+3T2(x)+4T3(x) pd = chebder (p)# first derivative print (pd) \#[14., 12.24.] pd2 = chebder (p,2)# second derivative print (pd2) \#[ 12.86.] print (polyval (5,pd2)) \# second derivative evaluates at x=5:492.0 Your task is to take the concepts above and then solve the boundary-value problem above for n=20. plot of the solution, which your code should generate, is given below: Your task is to take the concepts above and then solve the boundary-value problem above for n=20. plot of the solution, which your code should generate, is given below: The blue dots represent the n+1 points used to solve the equation - at these points the polynomial exactly solves the boundary-value problem. This strategy for solving boundaryvalue problems is known as collocation and is also referred to as a spectral method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!