# Question:Why doesn't dsolve[events] return the good results?

## Question:Why doesn't dsolve[events] return the good results?

Maple 2015

Hi,

Why extracting the features of the events doesn't return the good results when executed within a loop (see the pink test) ?

PS: please, spare me  replies of the type "you can solve this equation formally"

 > restart;
 > interface(version);
 (1)
 > sys := { diff(x(t), t) = 1, x(0) = 0 }: evs := [ [x(t)-0.1, none],  [x(t)-0.3, none], [x(t)-0.5, none] ]: sol := dsolve(sys, numeric, events=evs): plots:-odeplot(sol, [t, x(t)], t=0..0.5, gridlines=true);
 > # times that fired the events sol(1): # initialization sol(eventfired=[1]); sol(eventfired=[2]); sol(eventfired=[3]);
 (2)
 > # Same times computed  within a loop for i from 1 to 3 do   te := op(sol(eventfired=[i])); end do;
 (3)
 > # Values of x(t) computed  within a loop # # Why are calues for events 2 and 3 wrong ? for i from 1 to 3 do   te := op(sol(eventfired=[i])); # xe := sol(te);             # this doesn't return the correct result, # xe := subs(sol(te), x(t)); # this doesn't work neither   xe := eval(x(t), sol(te)); # this doesn't work neither end do;
 (4)
 >