ODEs: Changing a parameter during simulation

Hello, I am a new user of Mathematica, and I have the folowing question.

I am solving a system of ODEs numerically with NDSolve, the independent variable being time (t), and I would like to change a parameter during the time course. E.g., for a particular parameter {p - > 0.9} I would like to set it to 1.0 if 200 < t <= 500 and for t > 500 reset it to 0.9. How can this be done? I have tried with „WhenEvent“ but I didn’t succeed.

Thanks a lot in advance, Christian

You can use something like this:

In[7]:= p[t_] := If[200 < t <= 500, 1, 0.9]

In[8]:= p[100]

Out[8]= 0.9

In[10]:= p[300]

Out[10]= 1

In[11]:= p[600]

Out[11]= 0.9

Thanks a lot, that works!

Kind regards,
Christian