No uniqueness of solutions

In [30]:
var('x,y')
ode_rhs = sqrt(abs(y))
p = plot_slope_field(ode_rhs, (x,-10,10), (y,-5,5), headaxislength=3, headlength=3, color='darkred')
p=p+desolve_rk4(ode_rhs, y, ivar=x, ics=[0,0],end_points=[-10,10] , output='plot',xmin=-10, xmax=10, ymin=-5, ymax=5, color='blue')
p=p+desolve_rk4(ode_rhs, y, ivar=x, ics=[1,1/4],end_points=[-10,10] , output='plot',xmin=-10, xmax=10, ymin=-5, ymax=5, color='blue')
p=p+desolve_rk4(ode_rhs, y, ivar=x, ics=[6,1/4],end_points=[5,10] , output='plot',xmin=-10, xmax=10, ymin=-5, ymax=5, color='blue')

p
Out[30]:
In [31]:
plot(sqrt(abs(x)), (-4,4),  ymin=-1, ymax=1)
Out[31]:

Picard-Lindelöff iteration for $f'=f$

In [38]:
def f(n):
    if n == 0:
        return lambda x : 1
    else:
        return lambda x : f(n-1)(x)+x^n/factorial(n)

iteration = [plot(f(n), (-2,2),  ymin=-10, ymax=10) for n in range(10)]
a = animate(iteration)
a
Out[38]:

Nonautonomous 2-D ODE

In [49]:
iteration = [plot_vector_field( (x^2-y,(y^2-4)*1/10*n^2) , (x,-3,3), (y,-3,3)) for n in range(-10, 10)]
a = animate(iteration)
a
Out[49]: