(* rk3stab.wl -- The linear stability domain for an RK3 method *)

k1=f[t,y[t]]
k2=f[t+2/5*h,y[t]+2/5*h*k1]
k3=f[t+4/5*h,y[t]-1/5*h*k1+h*k2]
method=y[t+h]==y[t]+h*(1/6*k1+5/12*k2+5/12*k3)
f=Function[{t,y},lambda*y]
method
Simplify[method/.{h->1,lambda->z}]
r=(6+6*z+3*z^2+z^3)/6
ra=Abs[r]
ra2=ra/.z->a+I*b
ContourPlot[ra2,{a,-4,2},{b,-3,3},
Contours->{1},ContourShading->{Red,Blue}]
