def generator():1t = var("t")2y, yp = mi_vars("y", "y'")34# pick a for y'-ay5a = randrange(1,6)*choice([-1,1])67# particular solution8b=a9while (b==a):10b = randrange(1,6)*choice([-1,1])11c = choice([-3,-2,2,3])12part_sol = choice([13c*exp(b*t),14c*exp(a*t)*t,15c*exp(a*t)*sin(b*t),16c*exp(a*t)*cos(b*t)17])18d = choice([-1,1])*randrange(1,5)19ode = shuffled_equation(yp,-a*y,-part_sol.diff()+a*part_sol)*d20k = var("k")21ode_sol = (y==k*exp(a*t)+part_sol)2223return {24"ode": ode,25"ode_sol": ode_sol26}272829