1. Homepage
  2. Programming
  3. Computing Methods Homework 2: Iteration, Taylor Series Expansion, Sine Table and Surface Mesh

Computing Methods Homework 2: Iteration, Taylor Series Expansion, Sine Table and Surface Mesh

Engage in a Conversation
MatlabComputing MethodsIteration Taylor Series Expansion Sine TableSurface Mesh

2023 Summer Computing Methods CourseNana.COM

Homework # 2 (100)

Problem # 1 (20)

One numerical method for calculating the cubic root of a number, √𝑃3 is in iterations. The process starts by choosing a value 𝑥1 as a first estimate of the solution. Using this value, a second, more accurate value 𝑥2 can be calculated with 𝑥2=(𝑃𝑥12+2𝑥1)/3, which is then used for calculating a third, still more accurate value 𝑥3, and so on. The general equation for calculating the value of 𝑥𝑖+1 from the val ue of 𝑥𝑖 is 𝑥𝑖+1=(𝑃𝑥𝑖2+2𝑥𝑖)/3. CourseNana.COM

Write a MATLAB program that calculates the cubic root of a number. In the program , use 𝑥1=𝑃 for the first estimate of the solution. Then, by using the general equation in a loop, calculate new, more accurate values. Stop the looping when the estimated relative error 𝜀 defined by 𝜀=|𝑥𝑖+1−𝑥𝑖 𝑥𝑖| is smaller than 0.0000 1. Use the program to calculate √17.6123, √216 .43 and √1423 .233. CourseNana.COM

Problem # 2 (20)

The Taylor series expansion for cos(x) is: cos(𝑥)=1−𝑥2 2!+𝑥4 4!−𝑥6 6!+⋯=∑(−1)𝑛 (2𝑛)!∞ 𝑛=0𝑥2𝑛 where 𝑥 is in radians. Write a MATLAB program t hat determines 𝑐𝑜𝑠 (𝑥) using the Taylor series expansion. CourseNana.COM

The program asks the user to type a value for an angle in degrees. Then the program uses a loop for adding the terms of the Taylor series. If 𝑎𝑛 is the nth term in the series, then the sum 𝑆𝑛 of the 𝑛 terms is 𝑆𝑛=𝑆𝑛−1+𝑎𝑛. In each pass calculate the estimated error 𝜀 given by 𝜀=|𝑆𝑛−𝑆𝑛−1 𝑆𝑛−1|. Stop adding terms when 𝜀≤0.000001 . The program displays the value of cos(x) . Use the program for calculating cos (35°) and cos (75°). Compare the values with those obtained by using Matlab cosd( x) function. CourseNana.COM

Problem # 3 (20)

Before calculators were readily available (about 1974), students used tables to determine the values of mathematical functions like sine, cosine, and log. Create such a table for sine, using the following steps: • Create a vector of angle values from 0 to 2 π in increments of p>10. • Calculate the sine of each of the angles, and gro up your results into a table that includes the angle and the sine. • Use disp to create a title for the table and a second disp command to create column headings. • Use the fprintf function to display the numbers. Display only two values past the decimal p oint. CourseNana.COM

Problem # 4 (20)

Biological oxygen demand (BOD) is a measure of the relative oxygen depletion effect of a waste contaminant and is widely used to assess the amount of pollution in a water source. The BOD in the effluent (Lc in mg/L) of a rock filter without recirculation is given by : CourseNana.COM

𝐿𝑐=𝐿0 1+(2.5𝐷2/3) √𝑄, CourseNana.COM

where L0 is influent BOD (mg/L), D is the depth of the filter (m), and Q is the hydraulic flow rate (Lc(m2∙day)). Assuming Q = 300 L/(m2∙day), plot the effluent BOD as a function of the depth of the filter (100 ≤ D ≤ 2000 m) for L0 = 5, 10, and 20 mg/L. Make the three plots in one figure and estimate the depth of filter required for each of these cases to obtain drinkable water. Label the axes and display a legend. CourseNana.COM

Problem # 5 (20)

The following equation describes the temperature distribution in a rectangular metal plate. The temperature on three sides is held constant at T1, and at T2 on the fourth side (see Figure ). The temperature T (x, y) as a function of the x,y coordinates shown is given by CourseNana.COM

𝑇(𝑥,𝑦)=(𝑇2−𝑇1)𝑤(𝑥,𝑦)+ 𝑇1, where 𝑤(𝑥,𝑦)= 2 𝜋∑2 𝑛∞ 𝑛 𝑜𝑑𝑑sin(𝑛𝜋𝑥 𝐿)sinh (𝑛𝜋𝑦 𝐿) sinh (𝑛𝜋𝑊 𝐿). CourseNana.COM

The given data for this problem are 𝑇1=60℃, 𝑇2=220℃, and W=L=1 m . Using a spacing of 0. 1 for both x and y, generate a surface mesh plot and a contour plot of the temperature distribution. CourseNana.COM

Bonus Problem (10) CourseNana.COM

Plot the function 𝑓(𝑥)=𝑥3−2𝑥2−10𝑠𝑖𝑛2(𝑥)−𝑒0.9𝑥 and its derivative for −4≤𝑥≤4 in one figure. Plot the function with a solid line, and the derivative with a dashed line. Add a legend and label the axes. Plot the curves with two different Matlab functions – plot and fplot , so you will have two figures. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Matlab代写,Computing Methods代写,Iteration代写, Taylor Series Expansion代写, Sine Table代写,Surface Mesh代写,Matlab代编,Computing Methods代编,Iteration代编, Taylor Series Expansion代编, Sine Table代编,Surface Mesh代编,Matlab代考,Computing Methods代考,Iteration代考, Taylor Series Expansion代考, Sine Table代考,Surface Mesh代考,Matlabhelp,Computing Methodshelp,Iterationhelp, Taylor Series Expansionhelp, Sine Tablehelp,Surface Meshhelp,Matlab作业代写,Computing Methods作业代写,Iteration作业代写, Taylor Series Expansion作业代写, Sine Table作业代写,Surface Mesh作业代写,Matlab编程代写,Computing Methods编程代写,Iteration编程代写, Taylor Series Expansion编程代写, Sine Table编程代写,Surface Mesh编程代写,Matlabprogramming help,Computing Methodsprogramming help,Iterationprogramming help, Taylor Series Expansionprogramming help, Sine Tableprogramming help,Surface Meshprogramming help,Matlabassignment help,Computing Methodsassignment help,Iterationassignment help, Taylor Series Expansionassignment help, Sine Tableassignment help,Surface Meshassignment help,Matlabsolution,Computing Methodssolution,Iterationsolution, Taylor Series Expansionsolution, Sine Tablesolution,Surface Meshsolution,