problem with an integral

1 view (last 30 days)
Guido De Angelis
Guido De Angelis on 29 May 2015
Answered: Walter Roberson on 30 May 2015
A system obey an equation of motion y''=f(y'(t),y(t),t) but f(y'(t),y(t),t) change as a function of y(t).
For example if y>=0 then y''=g(y'(t),y(t),t) and if y<0 then y''=h(y'(t),y(t),t).
Is it possible to write a script with a solver that can integrate "the right function at the right moment"? Anyone could help me? Thanks a lot!

Answers (1)

Walter Roberson
Walter Roberson on 30 May 2015
y'' = Heaviside(y) * g(y'(t),y(t),t) + Heaviside(-y) * h(y'(t),y(t),t)
Provided, that is, that Heaviside(x) is defined as 0 when x is 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!