Help a noob implement MATLAB for a math iteration
Ältere Kommentare anzeigen
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 Kommentare
Matt J
am 8 Okt. 2013
I've read the manual but I still don't understand.
Really? Not one word of it?
Duke
am 11 Okt. 2013
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
am 13 Okt. 2013
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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!