Thank you, this helped me :) I also have a couple of suggestions for your code... Since you are only working with vectors, you dont need the ,: in all the vectors, dunno if it makes a difference. I can also recommend using the 'axis equal' command before the xlim and ylim, this way you ensure that the length of the pendulum does not change. Lastly, if you would like to see the animation 'live' and not just after recording a video, you could use the 'pause(0.2)' function as the last part of the loop. :)
Glad I could help! Yes, my array indices are rather redundant - since they're 1-D, I could just specify x(n) rather than x(n,:), etc. And yeah, 'axis equal' would help - didn't think of that! Thanks for the tip about viewing the animation 'live.'
@@ironpine5815 I used your script as a basis for making this video ua-cam.com/video/MQlXfUSVuK0/v-deo.html. I also found out that you missed a '+1/2*alpha*tStep^2' term in your calculation of theta... However with small timesteps this error will be very small per timestep, but it will accumulate over time :)
Why is the animation 16 seconds long when the simulation time is only 10 seconds? And I find that my animation becomes faster and has more oscillations when I increase the time step, which doesn't make sense to me since the simulation time is the same
what could i do in order to have in the x axis the time in seconds and not the number of iterations? My goal is to reach a graph with accel. on y axis and time on x axis
It's pretty simple to do. The simulation time step is set on line 12 of the MATLAB code (tStep). Create an array that increments by tStep that is the same length as your position, velocity, and acceleration arrays. Then you can plot using this "time" array.
@@ironpine5815 can you write it for me? I barely can use matlab, I'm a lot ignorant in that and I'm on a nerve crisis because I'm working on something similar since this morning because I'm on a hurry. Sorry for asking but I really need help, if you can't write it down for me, at least please tell me how to do it step by step. Thanks and sorry again
@@StellarHamster I think I explained it to you pretty step-by-step. I won't write the code for you though - if this is one of your assignments/projects/etc, then you need to be the one doing the work.
@@kizilayk I don't know what you mean by "disappear and flash" - in the video that MATLAB exports, it should be smooth and the pendulum bob shouldn't disappear.
I'm not sure how to resolve this issue. It appears to be something with your permissions on your computer - make sure MATLAB has permission to create files.
This is the kind of knowledge that I would gladly pay someone else to learn.
Thank you, this helped me :)
I also have a couple of suggestions for your code...
Since you are only working with vectors, you dont need the ,: in all the vectors, dunno if it makes a difference.
I can also recommend using the 'axis equal' command before the xlim and ylim, this way you ensure that the length of the pendulum does not change.
Lastly, if you would like to see the animation 'live' and not just after recording a video, you could use the 'pause(0.2)' function as the last part of the loop. :)
Glad I could help!
Yes, my array indices are rather redundant - since they're 1-D, I could just specify x(n) rather than x(n,:), etc.
And yeah, 'axis equal' would help - didn't think of that!
Thanks for the tip about viewing the animation 'live.'
@@ironpine5815 I used your script as a basis for making this video ua-cam.com/video/MQlXfUSVuK0/v-deo.html. I also found out that you missed a '+1/2*alpha*tStep^2' term in your calculation of theta... However with small timesteps this error will be very small per timestep, but it will accumulate over time :)
@@NikoBiele Please, I tried to add the term you mentioned but it appeared an error
Thank you for your technical explained Newton's second law in very easy understand.
Ladies and gentlemen, he's back.
Am I?
Maybe
Thanks for your video ,i have a question Is That a analytical or numerical solution?
This is a numerical solution since I use Euler's method to solve the second order ODE.
How can you execute the code inorder to get this video of the simulation ?
how can I save this video in file manager, can you please tell me about that
Why is the animation 16 seconds long when the simulation time is only 10 seconds? And I find that my animation becomes faster and has more oscillations when I increase the time step, which doesn't make sense to me since the simulation time is the same
what could i do in order to have in the x axis the time in seconds and not the number of iterations? My goal is to reach a graph with accel. on y axis and time on x axis
It's pretty simple to do. The simulation time step is set on line 12 of the MATLAB code (tStep). Create an array that increments by tStep that is the same length as your position, velocity, and acceleration arrays. Then you can plot using this "time" array.
@@ironpine5815 can you write it for me? I barely can use matlab, I'm a lot ignorant in that and I'm on a nerve crisis because I'm working on something similar since this morning because I'm on a hurry. Sorry for asking but I really need help, if you can't write it down for me, at least please tell me how to do it step by step. Thanks and sorry again
@@StellarHamster I think I explained it to you pretty step-by-step. I won't write the code for you though - if this is one of your assignments/projects/etc, then you need to be the one doing the work.
@@ironpine5815 done this morning, thanks. Sorry for the panic, I learned something
@@StellarHamster I'm glad you got it figured out!
I really need this code. Can you please give it to me
You can download the code using the links in the video description.
Can you help me please
Can you give me book modeling pandulum by matlab simulink
How does this red point disappear and flash? Like an ambulance.. Tick tock
Please help me
@@kizilayk I don't know what you mean by "disappear and flash" - in the video that MATLAB exports, it should be smooth and the pendulum bob shouldn't disappear.
In video code it showing that cannot create file pendulum.avi. permission denied tell me the solution for this
I'm not sure how to resolve this issue. It appears to be something with your permissions on your computer - make sure MATLAB has permission to create files.