Many applications use the following “small angle” approximation for the sine to obtain a simpler model that is easy to understand and analyze. This approximation states that sin x ≈ x, where x must be in radians. Investigate the accuracy of this approximation by creating three plots. For the first, plot sin x and x versus x for 0 ≤ x ≤ 1. For the second, plot the approximation error sin x - x versus x for 0 ≤ x ≤ 1. For the third, plot the relative error [sin(x) - x]/sin(x) versus x for 0 ≤ x ≤ 1. How small must x be for the approximation to be accurate within 5 percent?

6 Comments

Please read this guide about getting help with homework, and edit your question accordingly.
The topic is not like that. I have a solution to the question, but I do not understand the code
Mahmoud Ibrahim
Mahmoud Ibrahim on 21 May 2023
Edited: Mahmoud Ibrahim on 21 May 2023
this is the solution but why we used abs here in second plot and multi 100 in the third plot @the cyclist
The m-file:
x = 0:0.01:1;
subplot(2,2,1)
plot(x,sin(x),x,x)
xlabel('x (radians)'),ylabel('x and sin(x)')
gtext('x'),gtext('sin(x)')
subplot(2,2,2)
plot(x,abs(sin(x)-x))
xlabel('x (radians)'),ylabel('Error: sin(x) - x')
subplot(2,2,3)
plot(x,abs(100*(sin(x)-x))./sin(x))
xlabel('x (radians)'),... ylabel('Percent Error'),grid
My hypothesis is that you found this solution to your homework on the web, and you don't understand it.
I will give you a couple small hints, under the assumption that you would still like to learn.
Hint #1 (about using abs): If you are making an error, do you care what direction the error is in?
Hint #2 (about multiplying by 100): Think about what percent error means.
@the cyclist Bro i do not have an acc on this chegg site.
It is not homework
i just want to understand because i have an exam tomorrow and i solve many example to be ready
The information on this Wikipedia page may help you understand the use of abs and why the code multiplies by 100.

Sign in to comment.

 Accepted Answer

Image Analyst
Image Analyst on 21 May 2023
This looks like a homework problem. If you have any questions ask your instructor or read the link below to get started:
Obviously we can't give you the full solution because you're not allowed to turn in our code as your own.
To learn fundamental concepts, invest 2 hours of your time here:

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!