Harmonic oscillator with piecewise excitation force
Toolboxes for parameter continuation and bifurcation analysis.
Brought to you by:
fschild,
hdankowicz
Hi Jonathan,
The
hspoconstructors were designed to handle problems with piecewise-defined vector fields, so that discontinuities would not affect the accuracy of the results.There are two issues here: the lack of smoothness (or even continuity) of the vector field and the lack of smoothness of the solution. The former means that your problem Jacobian will change discontinuously as mesh points move across the discontinuity. It is still possible (perhaps even likely, but surely problem-dependent) that the iterations will converge. But to what? After all, the discretization assumes a continuous, piecewise-smooth solution along each trajectory segment. You may need many more discretization points near the discontinuity to capture the sudden transition at least approximately.
All of this is to say that I don't know how much of an effect it will have in practice, but my general recommendation is to segment your trajectory. There is definitely a long history of investigators either segmenting the problem or replacing the non-smooth vector field with one that is "regularized." Either way, give it a try with conditionals and see what happens.
Best,
Harry
Oh, and since the
hspoconstructors assume an autonomous vector field, you can either replace your harmonic forcing with a scaled version of one of the components of the Hopf normal form dynamics or introduce a phase variable that gets reset at a phase reset event (like in theimpactdemo.Thank you, Harry! I think I get the concept of the impact demo. But the part with the phase reset event is not clear to me. I understand it like
if omega * t = pi
then the reset map changes it to omega * t = 2 * pi
But I still search for the reason for that.
Hi Jonathan.
The phase reset event triggers when
x(3)-pi=0and at that point resetsx(3)tox(3)-2*pi, in other words so that while the phase ispiat the terminal point of the incoming segment, it is-piat the initial point of the outgoing segment.Similarly, the impact event triggers when
x(1)-p(5)=0and at that point resetsx(2)to-p(6)*x(2), in other words so that while the displacement isp(5)at the terminal point of the incoming segment, the outgoing velocity is-p(6)*x(2). Here,p(6)is the coefficient of restitution.I hope that helps.
Harry
Last edit: Harry Dankowicz 2024-04-18
Ok, now I understand the code, thank you. But regarding the meaning of this: Why should there be a phase jump from
pito-pi? Is it because of the change of direction of the system? Because if yes, I think I don't need that event function in my system.Hi Jonathan,
The phase lives on S^1, but since Matlab works in R^1, I map S^1 onto [-pi,pi] and identify the end points. The jump from pi to -pi just brings the phase back to the beginning of the interval. There is no relationship to directions. The phase always increases at a constant rate.
I hope that helps.
Harry
Ok, thanks a lot!