math307_Section_6.2

827 days ago by jay

Example 6.2.1

Here we plot the range of solutions to the differential equation

y''-y'-2y=0
whose general solution is
y=c_1 e^{-t} + c_2 e^{2t}.

Just below y_1 and y_2 are defined.

y_1 = lambda t,c: c*e^-t y_2 = lambda t,c: c*e^(2*t) 
       

This is a plot of y_1 taking values of c_1 between 1 and 10 inclusive.

G_1 = plot(y_1(x,1), [x,0,2]) for c in range(2,11): G_1 = G_1 + plot(y_1(x,c), [x,0,2], rgbcolor=(0.0,c/10.0,0.5)) G_1 
       

This is a plot of y_2 taking values of c_2 between 1 and 10 inclusive.

G_2 = plot(y_2(x,1), [x,0,2]) for c in range(2,11): G_2 = G_2 + plot(y_2(x,c), [x,0,2], rgbcolor=(c/10.0,0.0,0.5)) G_2 
       

This is a composite graph showing the range of values that the function y can take.

var('u,v') G = plot3d(y_1(u,v)+y_2(u,2), (u,0,1), (v,0,100)) r = 5 # range for c_2 in range(2,r+1): G = G + plot3d(y_1(u,v)+y_2(u,c_2), (u,0,2), (v,0,100), rgbcolor=(c_2/r,0.5,0.0)) G