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 件のコメント

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

サインインしてコメントする。

 採用された回答

Image Analyst
Image Analyst 2023 年 5 月 21 日

0 投票

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:

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by