Open pkudzia opened 5 years ago
About solutions, please share your private repository with me. For future assignments, we'll arrange this through GitHub Classroom. I may be able to set that up even for present assignment as well.
Q6: I believe Manoj is referring to trajectory optimization. When doing optimization, people often prefer not to have simulation end due to event, but rather ask the optimizer to find conditions that satisfy the same constraint. This is in part because there are usually multiple constraints to satisfy, and it is best to deal with them all at once. That said, once you have an optimal solution, it's often a good idea to run that through a simulation with event detection, just to make sure everything works. It's possible to get optimal solutions that simulation show to be infeasible.
Art, I do believe it public as i forked it with the hw repository. But this is the location : https://github.com/pkudzia/hw00.git
Thanks for the feedback on Q6, makes sense and clarifies things for me !
I forked my solutions into a new repository on my account . Is this the correct way to submit code responses ?
Question 4
First rewrite the pendulum equation in terms of theta’’ = wn^2theta.
To simulate this second-order differential equation we need to convert it to a series of first order equations. To do this we re-write out the vector, lets call it x, which has two components : { x1 = theta , x2 =theta’ } next we write out the derivatives of those : {d/dt x1 = x2 , d/dt x2 = wn^2x1} We would then be able to set up the ode45 solver and make wn variable that is equal to 1 and solve our ODE.
Question 5
We can simulate this initial value problem (IVP) similarly as noted above. Since it is a first order we write series of equations which could simply too {d/dt x1 = -y(1)} in the @f of the ode solver. Would then run it from a starting condition of x0 =1 over a defined tspan. To solve the IVP.
Question 6
Manoj once told me that event detection is not the ‘best' approach in ODE simulation. I forget exactly why but I think he meant that the approach isn’t robust. Can anyone comment on this or has experiences that can speak to this ?