I used implicit Euler and fixed step size to solve the differential equation, but the system prompted that “FixedStep” cannot be used. What is the reason for this and how should I modify the program?
system = {vi q[t] == l il'[t] + ir[t] r, il[t] == ir[t], il[0] == 0};
control = {q[0] == 1,
WhenEvent[Mod[t, \[Tau]] == (2/3) \[Tau], q[t] -> 0],
WhenEvent[Mod[t, \[Tau]] == 0, q[t] -> 1]};
pars = {vi -> 24, r -> 22, l -> 2 10^-2,
c -> 1 10^-4, \[Tau] -> 25/10 10^-4};
sol = NDSolve[{system, control} /. pars, {il, q}, {t, 0, .2},
StartingStepSize -> step,
Method -> {"FixedStep", Method -> "LinearlyImplicitEuler"},
DiscreteVariables -> q];
a = Evaluate[il[t] /. sol];
Plot[a, {t, 0, 0.06}, AxesLabel -> {"s", "il[t]/A"},
PlotLegends -> {"LinearlyImplicitEuler"}, PlotStyle -> {Red},
PlotRange -> All]