#3.4 FE 3 var("N,P") plot_vector_field((0.1*N*(1-(N/5000)),.001*N*P-.001*P),(N,-10,10),(P,-10,10),axes_labels=["Prey","Predator"])
(N, P)
#Practice Exam def temp(t): if t>85: print "It's hot" elif t<65: print "It's cold" else: print "Not bad" temp(86) temp(64) temp(75)
It's hot
It's cold
Not bad
peng=[62,93,75,56,76] ig=[34,21,15,25,34] list_plot(zip(peng,ig),axes_labels=["Penguins","Iguanas"],color="green",size=30)
var("N","P")#Error 1, misplaced quotation marks. Creates symblic variables. t = srange(0,100,0.1) #Error 2, missing parenthesis. Creates list from 0-100 in steps of .1 and assigns to t. sol=desolve_odeint([0.5*N - 0.01*N*P, 0.5*0.01*N*P - 0.2*P],ics=[50,75], dvars=[N,P], times=t)#Error 3/4 Missing * between 0.2 and P with undefined variable t1. Runs euler's method on given equation. list_plot((t, sol[:,0])) + list_plot(zip(t,sol[:,1]),#Error 6 second plot uses "plot", plots every value of N and P as they correspond to each other. color="red")
(N, P)
3D rendering not yet implemented