︠53e0da90-32d7-4c94-8bc6-0fc9361ebfeas︠ # declare the variables x, y, t = var('x y t') # declare the system F = [-3*x - 2*y, 2*x + y] # create the vector field # normalize the vector fields so that all of the arrows are the same length n = sqrt(F[0]^2 + F[1]^2) # plot the vector field pQuiz09 = plot_vector_field((F[0]/n, F[1]/n), (x, -4, 4), (y, -4, 4), aspect_ratio = 1) # plot the straightline solutions [-1,1]^T => y = -x pQuiz09 += plot(-1*x, x, -4, 4, thickness = 2, color = 'red', xmin = -4, xmax = 4, ymin = -4, ymax = 4) # solve the system for the initial condition t = 0, x = 1, y = 1 P1 = desolve_system_rk4(F, [x, y], ics=[0, 1, 1], ivar = t, end_points = [-5,5], step = 0.01) # grab the x and y values from the set P1 S1 = [ [j, k] for i, j, k in P1] # plot the solution pQuiz09 += line(S1, thickness = 2, axes_labels=['$x(t)$','$y(t)$'], xmin = -4, xmax = 4, ymin = -4, ymax = 4, color = 'blue') # display the final plot show(pQuiz09) # Save the plot as a pdf to use in LaTeX or Word or your program of choice. pQuiz09.save('295_03-05_Quiz_09.pdf') ︡75df226e-2ab4-4201-b49a-d4e831ceea1e︡{"file":{"filename":"/home/user/.sage/temp/project-ad524c2d-4b3b-45d8-80a2-ecd740477e27/633/tmp_21vtnd89.svg","show":true,"text":null,"uuid":"8c410cf4-2fe6-4618-a188-3806bae53216"},"once":false}︡{"done":true}