Help a noob implement MATLAB for a math iteration
이전 댓글 표시
Alright guys I'm new to Matlab and have no idea how to use it. I've read the manual but I still don't understand. I need to implement Kepler's problem iteration.
equation 1: 0.69=E-0.82sinE where E is in radians. A random E will be plugged in by the user, and the MATLAB program has to iterate until 0.69 is achieved.
There's a formula for the E iteration values.
equation 2: E(i+1)=Ei+(0.69-Mi)/(1-0.82cosEi) This reads the E subscript i+1 value equals the E subscript i value ......etc. The Mi is equivalent to equation 1, where M=0.69. So Mi would just be what Ei plugged during the iteration.
Example: I choose Ei=0.5 and plug it into my iterative MATLAB function. Then equation 1 becomes M=0.5-0.82sin0.5. Hence Mi=0.10687. Then solve equation 2 for E(i+1). Get E(i+1)=2.5796. Then this becomes the next E value, and the process repeats itself UNTIL 0.69-Mi goes near to 0. I need a convergence tolerance of 10^-7, whatever that means.
I apologize for my poor explanation of the math problem. Fortunately the textbook is online: http://www.fgg.uni-lj.si/~/mkuhar/Zalozba/Fundamentals_of_Astrodynamics-Bate_Mueller&White-1971.pdf
Go to pages 220-222 (the book pages) section 4.6.4. Equation 1 is 4.2-6, and equation 2 is 4.6-40.
Do I use a if function?
Thanks.
댓글 수: 3
Matt J
2013년 10월 8일
I've read the manual but I still don't understand.
Really? Not one word of it?
Duke
2013년 10월 11일
One of the big things that’s wrong with this forum is being think they are above everyone else because they know a broken tool better than other people (The amount of down time MatLab caused me when it crashed is astronomical). I found Matt reply as him being a jerk and belittling the poster. There are a few other people that are sarcastic all the time as well. I have no idea what the poster said, but after the comment Matt left I'd be upset as well.
Jan
2013년 10월 13일
Sorry, Duke. I've removed by contributions to this discussion, because I assume, it is not of public interest. Unfortunately this steals the context of your comment.
I suggest not to take the messages of others personally in a forum.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!