LagrangeINT留学生作业代写、代做MATLAB程序作业、MATLAB编程作业调试、代写Data files作业代写Python编程|代写留学生 Sta

Computational Project 3due: 03/04/2019, 5 p.m.Last updated February 27, 2019.Instructions New format guideline! Submit electronic copy of code, which must produce anddisplay all requested figures and output, and also submit a hard copy only of answersto questions not already included directly in your code output. Results output to thescreen must use fprintf and an indicator of which question is being answered, forexample,fprintf(‘Prob 1(b): best estimate of viscosity is %f ’, viscosity) Data files such as stress.txt and the LagrangeINT.m will be located in the TAs’ localdirectory when they test your code, so you don’t need to include these in your code.Problems1. Consider a fluid with velocity vx in the x-direction changing as a function of y.The sheer stress in a fluid, τ , is related to the viscosity μ and the strain rate, γ,where γ =vxy . For pseudo plastic fluids, e.g., shampoo, these are related asτ = μγnFor Newtonian fluids, these are related asτ = μγFor Bingham plastics (e.g., toothpaste), there is a threshold, τy, to overcome beforeNewtonian fluid properties are exhibited. In this case the stress-strain relationship isτ = τy + μγYou have performed experiments at a variety of strains and measured the resultingstresses on an unclassified fluid sample. The data are in the strain.txt andstress.txt files. Using this data set, write code that uses linear regression to fit thedata for each of the three potential models described above. You may solve the regressionequations yourself or use MATLAB statistical commands, such as regstats.For each of the three models, your code should generate a scatter plot of the stressversus strain data along with the regression line. In a separate plot, also show the1residuals (ri’s) as a function of the strain rates for each fit. Use the subplot commandto put all of these plots into a single figure. Clearly label your plots (titles,axis labels, legends).Based on further analysis of your results, include a writeup that answers the followingquestions:(a) to which class of fluids does this sample most likely belong? Justify your answer.(b) what is your best estimate of the sample’s viscosity?22. In this problem we will explore the fitting of data points yi with polynomial functionsof order p at various values of xi, whereyi = a0 + a1xi + a2x2i + a3x3i + . . . + apxpi + ri,and ri is the residual error. This relationship can be summarized more concisely asy = Xa + r. The following steps explore how different approaches to finding thecoefficients a lead to better or worse fits to the data.(a) Download data for x (temperature.txt) and y (density.txt) for a liquid metal.Plot the density [g/cm3] as a function of temperature [K].(b) Calculate the coefficients of a 5th order regression polynomial using the polyfitfunction. Then, using polyval, evaluate this polynomial as x goes from 396 to512 in intervals of size 0.5. Add a plot of this polynomial to your figure as asolid black line.(c) Calculate the coefficients of a 5th order regression polynomial by directly solvinga = (XT X)1XT y.Then, using polyval, evaluate this polynomial as x goes from 396 to 512 inintervals of size 0.5. Add a plot of this polynomial to your figure as a solid blueline. For a calculated this way, you may need to flip a in order to use polyval.(d) Repeat (b), but for p=24. Add a plot of this polynomial to your figure as adashed black line.(e) Repeat (c), but for p=24. Add a plot of this polynomial to your figure as a dashed blue line.(f) Use the LagrangeINT.m function that comes with your textbook to evaluate a24th order interpolating polynomial as x goes from 396 to 512 in intervals ofsize 0.5. Add this polynomial to your plot as a solid green line.(g) Add a legend to your plot, labeling all lines. Use the axis command to restrictthe y-axis range of your plot so that the different lines and datasets are clearlydiscernible.(h) Which numerical method of finding the regression polynomial works better forsmall values of p? For large values of p?(i) Using the best polynomial you found, estimate the metal’s density at 440 K.(j) BONUS: For polynomial fits of order p = 2 to p = 24, calculate the sum ofsquared residual error (E =Pni=1 r2i) using both the method in part (b) andpart (c). Plot E for each as a function of p on the same plot. The range ofvalues of E spans several orders of magnitude, so use a logscale for the y-axiswith the semilogy command.3Table 1:x y0 01 -6.62 9.13 6.44 -7.63. Given the following data,calculate the equations for an ‘unnatural’ quadratic spline. This type of spline imposesas an additional constraint that the second derivative of the spline is zero forthe last spline (between x = 3 and x = 4), instead of for the first spline.(a) Write down the set of equations you need to solve to find all of the splinecoefficients.(b) Find the polynomial coefficients of each spline function.(c) Plot the data and the interpolating spline functions between the data points.Tip: here is some code to plot a quadratic polynomial with coefficients a(1),a(2), and a(3) over the range from x(1) to x(2),syms xsf = a(1) + a(2) * xs + a(3) * xs^2ezplot(f,[x(1) x(2)])(d) Add to your plot a cubic spline calculated using MATLAB’s spline command.本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(LagrangeINT留学生作业代写、代做MATLAB程序作业、MATLAB编程作业调试、代写Data files作业代写Python编程|代写留学生 Sta)