” ECON 457 写作、 辅导Python编程语言ECON 457 – A01Computational EconomicsUVIC – Department of EconomicsSpring Term 2020/21Assignment 1Due on Brightspace before 11pm January 29th 2021Please create and submit a pdf file, making sure that its readable and unlocked.The file name has to follow this template: 457 PS1 Surname Name StudentNumber.pdfYou can cooperate with other students, but no group submissions will be acceptedIf you do cooperate, please list the other students names in the cover pageNo Photocopyanswers will be acceptedNo late submissions will be acceptedNOTE: YOU MUST INCLUDE THE ASSIGNMENT COVER PAGE(Failure to do so will entail a 5-point deduction from the grade received)Remarks: Your answers have to be submitted in a report format. Relying on Jupyter is the easiestoption. The codes you developed have to be included as well in the pdf file. Devote some time to give thegraphs, plots and tables a format easy to understand. Also the way you present your answers matters forthe final grade. Even if a question is mainly technical, briefly explain what you are doing, stressing theeconomic meaning of the various steps whenever possible. Being able to convey your thoughts effectively isan asset also in real life.Question 1: Plotting functions with discrete grids (40 Marks)Use Python to create the following graphs:(a) Plot the function f(x) = 1/(1 x2) on the interval [2, 2] using a grid of 11 evenly spaced points.(b) Plot the same function considered in part (a) on the interval [2, 2], now using a grid of 200 evenlyspaced points. Comment on the accuracy of the results.(c) Plot, in the same graph, these two trigonometric functions: f(x) = sin(2x) and g(x) = 2cos(x).Consider the interval [0, 2] and use a grid of 5 evenly spaced points. Redo the same plot using 101 points.Comment.(d) Create a figure with two panels. One panel should display the function f(x) = ln(x) on the interval(0, 5], while the other one should display the derivative of the same function. For both plots use an evenlyspaced grid with 101 points.The material contained in this document is copyrightedc , property of the University of Victoria, meant exclusively forthe use of students enrolled in ECON 457, and it cannot be shared without the authors explicit consent.Question 2: Market Equilibrium (60 Marks)Consider the market for a homogeneous good (say, a flu vaccine). The demand function is qd(p) = p,where 0 stands for the elasticity of demand. The supply function is qs(p) = p, where 0 is aconstant, and 0 stands for the elasticity of supply. Write Python codes to analyze this market in thefollowing cases.(a) Set = 1 and consider the following values for the elasticities: = 2 and = 3. Plot the twoindirect functions (note: the price has to be on the y-axis). Report the equilibrium price and quantity.(b) Now set = 2 and consider the following values for the elasticities: = {2; 0.5} and = {1; 3}.Write a do-loop where at each iteration the equilibrium price and quantity are computed and displayed (forall four combinations). Report these four combinations in a table and comment.(c) Now consider a different demand function, namely qd(p) = ep 0.01p. The supply function is qs(p) = p4. Adapt the code we discussed in class to find the numerical solution of the market equilibrium(note: the procedure might fail when using a poor initial guess). Plot the two indirect functions on theinterval [2, 2] and comment. Would it be a good idea to use p0 = 1.43 as the initial guess? Why or whynot? Find the numerical solution of the market equilibrium, report it and comment.如有需要,请加QQ:99515681 或WX:codehelp
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。