The Taylor-series expansion around zero (Maclaurin Series) for sin(x) can be written as follows: 00 sin(x)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The Taylor-series expansion around zero (Maclaurin Series) for sin(x) can be written as follows: 00 sin(x) = x²0+1 a) Write a Python function that generates the first 10 terms of the sin(x) Taylor-series expansion around zero. b) Create a plot (or a series of plots) that compares sin(x) with its Taylor series for [1,2,3,10] terms. (You can use a sampled x vector that goes from -10 to +10, on steps of 100). c) Plot ex and the first 10 real and imaginary terms of its Taylor series expansion near x = 0, where the Taylor expansion at 0 can be written as follows: (-1)" (2n)! (-1)" (2n+1)! (n)! #... n=0 x" = Σ n=() #... (-1)" (2n + 1)! n=0 where j2n = (j²)" = (-1)" and j2n+1 = j(j2)" =j(-1)". This should be a 3D plot with x on the x-axis, cos(x) on the y-axis and sin(x) on the z-axis. Hint for 3D plotting: plt3D.legend () plt.show() # get 3D plot area to plot on plt 3D plt.figure().add_subplot (111, projection='3d') #call plot functions with plt3D. instead of plt. #Note: plt3D is an "axis" object and its API uses #set_XXX for axis labels and limits where the pyplot API # would use just XXX. Example: plt.xlim() -> plt3D.set_xlim() + Σ -x-²0+1 7=() #make the plot plt3D.plot(x, y, z) # where x,y,z are what you want to plot #p1t3D.set_xlabel (<text>) #plt3D.set_xlim (xmin, xmax) = cos(x) + jsin(x) Act Go t The Taylor-series expansion around zero (Maclaurin Series) for sin(x) can be written as follows: 00 sin(x) = x²0+1 a) Write a Python function that generates the first 10 terms of the sin(x) Taylor-series expansion around zero. b) Create a plot (or a series of plots) that compares sin(x) with its Taylor series for [1,2,3,10] terms. (You can use a sampled x vector that goes from -10 to +10, on steps of 100). c) Plot ex and the first 10 real and imaginary terms of its Taylor series expansion near x = 0, where the Taylor expansion at 0 can be written as follows: (-1)" (2n)! (-1)" (2n+1)! (n)! #... n=0 x" = Σ n=() #... (-1)" (2n + 1)! n=0 where j2n = (j²)" = (-1)" and j2n+1 = j(j2)" =j(-1)". This should be a 3D plot with x on the x-axis, cos(x) on the y-axis and sin(x) on the z-axis. Hint for 3D plotting: plt3D.legend () plt.show() # get 3D plot area to plot on plt 3D plt.figure().add_subplot (111, projection='3d') #call plot functions with plt3D. instead of plt. #Note: plt3D is an "axis" object and its API uses #set_XXX for axis labels and limits where the pyplot API # would use just XXX. Example: plt.xlim() -> plt3D.set_xlim() + Σ -x-²0+1 7=() #make the plot plt3D.plot(x, y, z) # where x,y,z are what you want to plot #p1t3D.set_xlabel (<text>) #plt3D.set_xlim (xmin, xmax) = cos(x) + jsin(x) Act Go t
Expert Answer:
Answer rating: 100% (QA)
a Python function to generate the first 10 terms of the sinx Taylor series import math def sintaylor... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The Taylor series expansion for cos(x) is: where x is in radians. Write a MATLAB program that determines cos (x) using the Taylor series expansion. The program asks the user to type a value for an...
-
What would you suggest to be done and which principles are important to you in this decision? How would you think about the greatest good in this case? As a leader what are your duties and who are...
-
Recall the heat equation which we solved numerically T= = DTxx There we implemented an explicit numerical scheme (FTCS) which led to a conditionally stable solution - meaning that for certain time...
-
(a) Write a differential equation that expresses the law of natural growth. What does it say in terms of relative growth rate? (b) Under what circumstances is this an appropriate model for population...
-
A customer account in the accounts receivable subsidiary ledger of Landon Old Company follows. Describe the three posted transactions. ACOB WAITS Balance Date Post.Rf. DebCredit Debit Credit Nov. 1 9...
-
Using the data in question 4, Department Xs contribution to overhead as a percentage of sales is a. 20%. c. 12%. e. 32%. b. 30%. d. 48%. Data From Question 4 A company operates three retail...
-
Lansbury Company purchases equipment on January 1, Year 1, at a cost of $518,000. The asset is expected to have a service life of 12 years and a salvage value of $50,000. (a) Compute the amount of...
-
A center that has been in operation for five years needs Group of answer choices only an operating budget for the upcoming year only a long-range financial plan that includes a 10 year projection on...
-
McLennon Company had an Accounts Receivable balance of $320,000 and a credit balance in Allowance for Uncollectible Accounts of $16,700 at January 1, 2014. During the year, the company recorded the...
-
Choose a fortune 500 company and provide the following Company Overview: a. Name/Brand b. Most recent annual market share or revenue (from at least past two years) c. Products/Services offered....
-
What is a low-end disruption strategy?
-
What are four sets of challenges to sustained competitive advantage outlined in this chapter?
-
What do we mean by generic strategies?
-
How are people relevant to strategy formulation and implementation?
-
How is international expansion related to business and corporate strategy? Identify a firm that may be thinking of expanding into new international markets. Apply the staging element of the strategy...
-
The following information is available for Market, Inc. and Supply, Inc. at December 31: Required a. What is the accounts receivable turnover for each of the companies? b. What is the average days to...
-
Experiment: Tossing four coins Event: Getting three heads Identify the sample space of the probability experiment and determine the number of outcomes in the event. Draw a tree diagram when...
-
The demand function for yo-yos is D (p,M) = 4 2p + 1 / 100M, where p is the price of yo-yos and M is income. If M is 100 and p is 1, (a) What is the income elasticity of demand for yo-yos? _____ (b)...
-
We continue with the adventures of Agatha, from the previous problem. Just after the price change from $.10 per mile to $.05 per mile for second-class travel, and just before she had bought any...
-
Felicity loves her job. She is paid $10 an hour and can work as many hours a day as she wishes. She chooses to work only 5 hours a day. She says the job is so interesting that she is happier working...
-
a. What is profit analysis, also known as cost-volume-profit (CVP) analysis? b. Why is profit analysis so useful to healthcare managers? c. What is a profit and loss (P&L) statement?
-
a. What is cost shifting? b. What is cross-subsidization?
-
a. Write out and explain the equation for volume breakeven. b. What is the difference between accounting breakeven and economic breakeven?
Study smarter with the SolutionInn App