︠4044d4e3-e06e-4323-b0c5-439aa57f6e21i︠
%html
Gradient Fields - Example 1: Paraboloid (Bowl) $z=x^2-4x+y^2+2y$
YouTube PlayList on Gradient Vector Fields
︡cdfc70cd-9279-4933-9585-0dfe4e00580e︡{"html": "Gradient Fields - Example 1: Paraboloid (Bowl) $z=x^2-4x+y^2+2y$
YouTube PlayList on Gradient Vector Fields
"}︡
︠e8d4ae13-413c-4539-afe9-01d71c961360︠
var('x y')
g(x,y)=(x^2-4*x+y^2+2*y)
︡7b7a1e43-bc47-46fb-85fd-ab6dd079e1aa︡︡
︠cf0c706a-68d0-4f9d-8b4d-b8b38877b7a7︠
V=plot_vector_field(g.gradient(),(x,-5,5),(y,-5,5),color='red')
show(V, figsize=5)
︡0778956f-e179-468f-90ad-79b90bd7667a︡{"html": "
"}︡
︠c1ba324d-1678-479f-abb1-4e8f2b40e449︠
W = plot3d(g,(x,-5,5),(y,-5,5), aspect_ratio=[1,1,.2], adaptive=True,color=['red','yellow'])
S = sphere((2,-1,-5),size=1, color='blue', aspect_ratio=[1,1,1])
show(W + S, figsize=5)
︡32c936c2-cf63-433e-8b76-37d2cb6d448b︡︡
︠1f80481e-352a-4459-b412-a5d6e3f5b7b3︠
C= contour_plot(g,(x,-5,5),(y,-5,5), cmap='hsv',fill=False, contours=10)
show(C , figsize=5)
︡c49d83c2-9996-48a6-ae43-ee6ad5f188b8︡{"html": "
"}︡
︠6d9bf1f6-bf3b-46f1-90d0-204c8d95068f︠
show(C+V, figsize=5)
︡45ac27ca-ac18-4ef7-9eee-bf240bdc9a45︡{"html": "
"}︡