Hi, guys I have a problem here on how should I add a condition for variable “A” as shown in the image highlighted in red under equation 4 (eq4).
The condition I would like to set is that “A” equals "(b/m)p’[t] + (k/m)(p[t]-0.5) when “(p[t] >= l/2)” and “A” equals to zero when “(p[t] < l/2)” .
Any advise or changes I should make to the coding ? I truly appreciate your help here. Cheers.
Have you considered using a WhenEvent? I had a similar problem once myself. Check out the docs as well. It would be nice if you posted the code so one can copy it at run it easily instead of screenshoting it.
thanks man, but I still can’t get it using “While” though the site on doc recommended was helpful.
Anyway I’ve attached the nb. file and hopefully and you can test it out.
I appreciate your help very much.
Umm, the idea is that you should try the suggestion. You didn’t. You instead provided a notebook that won’t run the NDSolve, and fails for a very obvious reason. A bit of debugging before posting is always a good idea.