포물선 운동을 하는 공의 위치에 대한 수치를 Matlab을 통해 해석하고 해를 찾는 여러 방법의 장단점 파악
*희*
다운로드
장바구니
소개글
한쪽에서 공을 던지고 공이 포물선 운동을 하며 날아갈때 (공이 날아가는 위치를 나타내는 포물선의 함수를 알고있다.) 공이 떨어 질 위치를 Matlab을 이용하여 수치해석을 통해 찾는다.매트랩은 Bisection, Fixed point iteraion, Muller, Newton-Rhapson, Secant 법등을 이용해 수치를 해석하는데 각각 방법의 장단점 등을 파악하여 표를 만들어 정리하였다.
목차
1. Aerospace engineers sometimes compute the trajectories of projectiles such as rockets. A related problem deals with the trajectory of a thrown ball.The trajectory of a ball thrown by a right fielder is defined by the (x, y) coordinates as displayed in the figure. The trajectory can be modeled as
1) Plot the position of a thrown ball as a function of thrown angle and just estimate the root graphically.
2) Estimate the initial thrown angle by using the bisection and the false-position methods for the bracketing method, and the Newton-Raphson, the secant, and the Müler methods for the open method.
3) Estimate the distance x if thrown angle is pi/6 by using the fixed-point iteration methods. Is it possible? Make a discussion about this problem.
4) Plot the per cent approximate (relative) errors as a function of iteration for all methods. (Note that in your error graph, the scale of y-axis designating the error better to be expressed in logarithmic for a distinct comparison among various methods.)
5) Discuss about the most efficient numerical method to determine your answer and provide justification for your choice of method.
2. Devise your own problems to describe the pros and cons of each method you have learned, and solve them and discuss.
1) Just estimate the root graphically.
2) Bisection
3) False position mth
4) Newton-Raphson mtd
5) Secant
6) Muller mtd
7) Fixed point mtd
8) 결론
본문내용
(2) Estimate the initial thrown angle by using the bisection and the false-position methods for the bracketing method, and the Newton-Raphson, the secant, and the Müler methods for the open method.아래에서 여러 가지 method를 이용해 위의 함수식을 계속 사용 할 것이기 때문에 함수식을 m파일화해서 나만의 함수로 만들었고, 각 방법의 m-file은 교수님이 올려 주신 것을 이용했다.
* 내가 만든 함수
< Bracking mth >
& Bisection mth
위의 함수 hhj1.m을 이용하여 Bisection을 실행했다.
처음에 이러한 error가 발생했고, m-file에서 이런 error가 뜨는 이유를 찾아보았다.
----------------------------------------------
a(1)=a; b(1)=b;
ya(1) = feval(fun,a(1)); yb(1) = feval(fun,b(1));
if ya(1)*yb(1)>0.0
error('Function has same sign at end points')
-------------------------------------------------
즉, bisection의 양 구간의 함수값의 곱으로 해를 찾는 특징 때문에 처음에 범위로 지정한 a와 b를 hhj1함수에 넣었을 때 그 함수값의 곱이 같은 부호로 나와서 error가 발생한 것이었다.
b의 범위를 1번문제에서 짐작한 두해의 가운데 속해있는 값으로 잡고 다시 실행해 보았다.
>> bisect('fun1', 0, 0.7, 0.00001, 50)
<중 략>
17번의 반복후에 값을 찾았고, y값이 -0.0003이되는(error가 0.0001보다 작아야한다는 것을 만족시키는) 해는 0.6604였다.
1번의 해와 거의 일치했다.
>> bisect('fun1', 0.7, 1, 0.00001, 50)