Question
Matlab
The power series for the sin(x) is approximated by: 5 x sin x = x (-1)**r 20-4 + + 3! 5! 7! 9! 2n-1! a) Calculate sin(f/2) fo
0 0
Add a comment Improve this question Transcribed image text
Answer #1

For part a the MATLAB code is:

clc
m=100;
series1=0;
for i=1:m
p=(((-1)^(i+1))*((pi/2)^(2*i-1)))/factorial(2*i-1);
series1=series1+p;
end
series1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Ans of sin(pi/2) for m=100 is =1.000

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

For part b the MATLAB code is:

clc
m=5;
series1=0;
for i=1:m
p=(((-1)^(i+1))*((pi)^(2*i-1)))/factorial(2*i-1);
series1=series1+p;
end
series1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

ans of sin(pi) for m=5 is 0.0069.

ans of sin(pi) for m=100 is  3.3281e-16 which is approximately equal to zero.

So, m=100 is close to the exact value.

Add a comment
Know the answer?
Add Answer to:
Matlab The power series for the sin(x) is approximated by: 5 x sin x = x...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 5 xx The Taylor series expansion for sin(x) is sin(x) = x -H + E-E+...

    Problem 5 xx The Taylor series expansion for sin(x) is sin(x) = x -H + E-E+ = o E- (-1) . 2n +1 no (2n+1)! !57 where x is in radians. Write a MATLAB program that determines sin(x) using the Taylor series expansion. The program asks the user to type a value for an angle in degrees. Then the program uses a while loop for adding the terms of the Taylor series. If an n is the nth term in...

  • Use the binomial series to expand the function as a power series. f (x) = 5/1+...

    Use the binomial series to expand the function as a power series. f (x) = 5/1+ -5/1+ 6 15(-1)*+1 (0) 2n! IM n=0 00 5 5+ 12+ + [51-1)^-1 (a)" 2n! n=2 72 5+ =1041.32... (2n – 1) () 72 5+ 5(-1)"1.3.5. .... (2n - 3) 2n! n=2 (2n – 3) 72 5 5+ - + 12" 5(-1)n-11.3.5.... 2n! n=2 State the radius of convergence, R. (If the radius of convergence is infinity, enter INFINITY.) R = X Need Heln2...

  • n=0 4. Using the power series cos(x) = { (-1)",2 (-0<x<0), to find a power (2n)!...

    n=0 4. Using the power series cos(x) = { (-1)",2 (-0<x<0), to find a power (2n)! series for the function f(x) = sin(x) sin(3x) and its interval of convergence. 23 Find the power series representation for the function f(2) and its interval (3x - 2) of convergence. 5. +

  • In MATLAB The value of cos(x) can be approximated using a Maclaurin series + +... cos(x)=1-1...

    In MATLAB The value of cos(x) can be approximated using a Maclaurin series + +... cos(x)=1-1 2! 4! 6! Which can be expressed compactly as cos(x) = {(-1)+7 (2(k-1))! 00 2(k-1) k-1 Write Matlab code using a while loop that calculates cos(2) with 5 terms of Maclaurin series. Compare the value with the one calculated with a built-in function cos (2) in Matlab. The following is an expected output from your code: Using the Maclaurin series cos( 2.0) with 5...

  • Q1 2016 a) We want to develop a method for calculating the function f(x) = sin(t)/t...

    Q1 2016 a) We want to develop a method for calculating the function f(x) = sin(t)/t dt for small or moderately small values of x. this is a special function called the sine integral, and it is related to another special function called the exponential integral. it rises in diffraction problems. Derive a Taylor-series expression for f(x), and give an upper bound for the error when the series is terminated after the n-th order term. sint = see image b)we...

  • point) Consider a function f(x) that has a Taylor Series centred at x = 5 given...

    point) Consider a function f(x) that has a Taylor Series centred at x = 5 given by ſan(x – 5)" n=0 he radius of convergence for this Taylor series is R= 4, then what can we say about the radius of convergence of the Power Series an ( 5)"? nons A. R= 20 B.R= 8 C. R=4 D. R= E. R= 2 F. It is impossible to know what R is given this information. point) Consider the function f(x) =...

  • 1. What is the Maclaurin series for the function sin(x)? Please determine the minimum number of...

    1. What is the Maclaurin series for the function sin(x)? Please determine the minimum number of terms needed to compute sin(0.1) accurate to 12 decimal places (rounded), using a) Taylor’s theorem and b) alternating series theorem. Show your work and justify your answers for the above problem. 2. Create two random matrices A and B each of size ? × ?. Write a computer program in Java or Matlab to compute a) D(i, j) = A(i, j) * B(i, j)...

  • An alternative way for calculating sin(x) is to use its Taylor series as the following: sinx)x-+...

    An alternative way for calculating sin(x) is to use its Taylor series as the following: sinx)x-+ Create a function named "sin_taylor" in MATLAB. This function takes two inputs. First input is the angle, and the second input determines the number of terms in Taylor series for approximation. Check the fidelity of your function by running sin-taylor( 7) and compare it with the exact value of it. Hint: “factorial" is a built-in function that you can use for calculating factorial of...

  • find power series for (1/(1+x^2)). use this power series to prove that the taylor series centered...

    find power series for (1/(1+x^2)). use this power series to prove that the taylor series centered at x=0 for actan(x) is x -x^3/3 +x^5/5 -... (-1)^n ((x^2n+1)/(2n+1))...

  • Implement MATLAB code that calculates sin(x) using the following formula, and measure the absolute error from...

    Implement MATLAB code that calculates sin(x) using the following formula, and measure the absolute error from the MATLAB provided function. The Taylor's formula is given as follows: sin(x) = 0+12 + 0x² + 5123 + 0.x4 + ... 23 25 27 -3! + 5- 7 + ... Plot both (1) the approximated value, and (2) absolute error. The following example uses x = 3 * pi, and k = 50. You may choose your own x, and k values. Approximation:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT