Interactive animation while solving ODE
Show older comments
I am using ode45 to solve a system representing the inverted pendulum and its control. I am using the solution to plot the system in the form of an animation using the position x and the angle of the pendulum ϕ.
I would like to add new functionalities to this simulation, such as an external disturbance. I have been able to successfully code this functionality by changing the code, but it is static, i.e. I need to define the disturbance before calling ode45. Is there a way to solve / integrate this system in real time? I mean, I'd like to keep solving the system continuously, without defining a time range previously. This way, the user might disturb the system whenever he wants and the system will respond accordingly.
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!