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 comentarios

the cyclist
the cyclist el 21 de Mayo de 2023
Please read this guide about getting help with homework, and edit your question accordingly.
Mahmoud Ibrahim
Mahmoud Ibrahim el 21 de Mayo de 2023
The topic is not like that. I have a solution to the question, but I do not understand the code
Mahmoud Ibrahim
Mahmoud Ibrahim el 21 de Mayo de 2023
Editada: Mahmoud Ibrahim el 21 de Mayo de 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
the cyclist
the cyclist el 21 de Mayo de 2023
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.
Mahmoud Ibrahim
Mahmoud Ibrahim el 21 de Mayo de 2023
@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
Steven Lord
Steven Lord el 21 de Mayo de 2023
The information on this Wikipedia page may help you understand the use of abs and why the code multiplies by 100.

Iniciar sesión para comentar.

 Respuesta aceptada

Image Analyst
Image Analyst el 21 de Mayo de 2023

0 votos

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:

Más respuestas (0)

Categorías

Más información sobre Graphics Performance en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 21 de Mayo de 2023

Comentada:

el 21 de Mayo de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by