I have a very limited scoop when it comes to numerical programming and I am trying to get to better grips with i, and understand if there more efficient way of coding this but if possible I would like to understand what incorrect within my code, if possible. My only conclusion so far is that it either a variable I have missed or place wrong or my for stamen t is incorrect but cant see that being the case due to, using the equation for RK4 from a text book, which I have checked several times. I cannot understand to why my graph is being produced this way, I have gone through the code a couple of time, but cant see to find what is wrong. Here is the code which produces the given graph clc The graph that is being produced by my code is So the solution to the above equation is $y=3cos(\fracx)$, if i set k=1 and m=1, I should produce the following graph. The issue is that my code is not producing the expected plotted and I am not entirely sure, if it my RK4 that is wrong or my actual code that is wrong. Write a description of the procedure you followed and the data you collected to answer this question.So I am having a issue plotting a simply harmonic motion of the form
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |