Lab #8 - Slope Fields, Euler Approximations, and Integrals Calculus 1, Professor Samuels socrates.bmcc.cuny.edu/jsamuels please type your lab (you may write equations and graphs by hand) how do you use the slope field grapher: recall: suppose we know the formula for f '(x) and we know the value for f(a) ...but we dont know f(x)...how can we find f(b) ? we do an Euler approximation: we break up the interval from x=a to x=b into n equal pieces (we call that length Δx, or step size) f b= f a f ' a⋅a 1−a f ' a1 ⋅ a 2−a 1... f ' a n−1⋅b−a n−1 where the ai are x-values, evenly spaced out, Δx far apart [a is like a 0 ... b is like a n ] since all the differences are Δx, this simplifies to: f b= f a f ' a ⋅Δx f ' a1 ⋅Δx... f ' a n−1 ⋅Δx 1. y' = x2 - 2x ... f(.3)=.5 ... find f(.7) using step size=.1 by hand: f(.3) = .5 f(.4) = f(.3) + f '(.3)·(.1) = -1.1 + (.32 - 2· .3)(.1) = .449 f(.5) = f(.4) + f '(.4)·(.1) = .449 + (.42 - 2· .4)(.1) = .385 a) f(.6) = ? b) f(.7) = ? by grapher: dy in the box that says /dx type x2-2*x change the window: change “x-min” to -5, change “x-max” to 5 ... change “y-min” to -5, “y-max” to 5 click “submit all” to see the slope field for these values Δx is called the step size, enter it in the box labeled “step” note: for step size=.1, you must enter -.1 ... its a quirk of the software, always use a negative step f(.3) = .5 is the initial condition, enter the values in the boxes labeled “init. cond.” (x is .3, y is .5) click “submit” to see the function graph for this initial condition c) draw a sketch of this function. include ten slope field lines. you can also choose an initial condition by clicking on any point in the window...the grapher draws the graph through that point you can get a more precise slope field by adding more lines where it says “num of segs” put higher numbers ... i like 40 and 40 ... click 'enter' we can also see the numerical values click on “show table” does it match the calculations by hand? you can put the table of values in your lab report using 'copy' and 'paste' d) write down the first ten values in the table (up to x=1.3). be sure to identify your table with the differential equation, initial condition, and step size like this: y' = x2-2x ... f(.3)=.5 ... Δx=.1 note that the table stores every example, so look at the last example for your current calculation e) using step size=.1, what is the approximation of f(2.6) according to the table? f) if we took Δx smaller and smaller, that would give us an exact value and an integral. write down the statement in integral notation hint: f(b) - f(a) = ∫ab f '(x) dx g) solve the integral and find the exact value of f(2.6) for each answer write: the differential equation “y'=”, initial condition “f(a)=”, and step size “Δx=” to erase the functions and tables (but not the slope field), click “clear all” © Jason Samuels 2008 lets solve some differential equations ... some we can solve exactly ... 2. y' = x -3 ... f(1) = 2.7 ... use step size=.1 (remember to type -.1) a) sketch the function b) what is the approximation for f(2.4) ? (use the table of values) as Δx gets smaller and smaller, this becomes and integral which gives an exact answer. c) write the problem as an integral. then find the exact value of f(2.4) 1 ... f(1) = 0 ... use step size=.1 (remember to type -.1) x a) sketch the function using the grapher ... what function does it look like? b) what is the approximation for f(3) ? as Δx gets smaller and smaller, this becomes and integral which gives an exact answer. c) write the problem as an integral. then find the exact value of f(3) 3. y' = 4. y' = y ... f(0)=1 ... find f(4) change: y-max=100 a) use step size = 1 (remember to type -1) ... what is the approximation for f(4) ? b) use step size = .1 (remember to type -.1) ... what is the approximation for f(4) ? as Δx gets smaller and smaller, this becomes an integral which gives an exact answer. c) write the problem as an integral. For extra credit, find the exact value of f(4) [hint: the derivative of the function is the function...what function is that?] ... some we make an Euler approximation and look at the graph and table ... 2 5. y' = e− x (a very important function from statistics) ... f(0)=.5 ... find f(2) change: xmin=-5, xmax=5, ymin=-1, ymax=1.1 a) use step size = .1 (remember to type -.1) ... what is the approximation for f(2) ? as Δx gets smaller and smaller, this becomes an integral which gives an exact answer. b) write the problem as an integral. (Do not try to solve it... it is actually impossible) 6. y ' =−0.6 y (Torricelli's law of draining: y=height of the water, x=time ) type this as -.6*sqrt(y) ... change: x-min=-1, x-max=5, y-min=-2, y-max=5 a) this is the law for draining (e.g. water from a sink)... explain why it makes sense that there is a negative sign in front? b) if f(0) = 5, find f(5) with step size=.1 (remember to type -.1) c) try the initial condition (0,2) ... what happens to the graph (as x-values get bigger)? can you explain why this makes sense? (hint: think of the physical situation) 7. y' = y*(1-y) (the logistic equation...it is used to model the spread of disease, rumors, etc) a) enter initial condition (0,3) ... as x gets very big, what happens to the y-value? b) enter initial condition (0,2) ... as x gets very big, what happens to the y-value? c) enter initial condition (0,.5) ... as x gets very big, what happens to the y-value? d) enter initial condition (0,-.7) ... as x gets very big, what happens to the y-value? click many points on the slope field to generate lots of functions e) can you make a prediction for the y-value (at large x-values) based on the initial condition? © Jason Samuels 2008 8. y' = .32*(75 - y) (Newton's law of cooling: y=object temperature, room temperature=75) change: xmin=-1, xmax=20, ymin=-1, ymax=200 use step size = .1 (remember to type -.1) a) suppose a bowl of soup starts at 180o ... what is its temperature after x=10 minutes ? b) what trend in temperature do you notice on that function? c) generate several functions: click several points ... what do they have in common? why does this make sense? (hint: think about the physical situation) strange things can happen if your step size is large 9. y' = -sin(πx) type this as -sin(PI*x) set ymax=7 let the initial condition be (0,1) a) set step size=.1 (remember to type -.1) ... what function is drawn? b) what happens when you use step size=1 (remember to type -1) ? c) can you explain why this happened? [hint: look at the slope field and your points] 10. please write one paragraph about what you learned during this lab, and which activities helped you learn it. 11.was anything in this lab confusing? Is there anything you still don't understand? What would you change? © Jason Samuels 2008 ...and now for something a little different... [this is a 5-point extra credit mini-lab] so far, we have talked about: using the differential equation to find the original function, predicting and observing the behavior of a graph, and approximating values using Euler approximations. but some graphs can be very unpredictable. using Euler approximations for differential equations, we can make a function so that: - the graph is jagged with different values everywhere - the predicted y-value changes completely after the slightest change in the initial condition how will we do it? the trick: instead of taking Δx smaller and smaller, let Δx=1. this is called a discrete difference equation. discrete (a gap between each value) is the opposite of continuous (no gaps at all), and that will make all the difference. (just look at that last problem!) lets see some of the unusual function behavior that happens. we want Δx=1 for “step”, type -1 we want to observe the long-term behavior of these functions change x-max to 100 to answer the following questions, use both the graph and the table of values 12. y' = y2 + .25 - y a) for an initial value, put y=0 ... what happens to the y-value (as x gets bigger)? b) for an initial value, put y=.2 ... what happens to the y-value? c) for an initial value, put y=.3 ... what happens to the y-value? d) for an initial value, put y=.49 ... what happens to the y-value? e) for an initial value, put y=.5 ... what happens to the y-value? f) for an initial value, put y=.51 ... what happens to the y-value? g) can you look at the slope field lines and explain these different results? 13. y' = y2 - .8 - y a) for an initial value, put y=0 ... what happens to the y-value? b) for an initial value, put y=.2 ... what happens to the y-value? c) for an initial value, put y=.3 ... what happens to the y-value? d) for an initial value, put y=1.52 ... what happens to the y-value? e) for an initial value, put y=1.53 ... what happens to the y-value? f) can you look at the slope field lines and explain these different results? this is called sensitivity to initial conditions (also known as the butterfly effect) ... this is one of the definitions of CHAOS 14. y' = y2 - 1.31 - y a) for an initial value, put y=0 ... what happens to the y-value? b) for an initial value, put y=1.5 ... what happens to the y-value? c) for an initial value, put y=-1 ... what happens to the y-value? d) for an initial value, put y=2.1 ... what happens to the y-value? e) can you look at the slope field lines and explain these different results? 15. y' = y2 - 2 - y a) try any four initial values for y ... in each case, what happens to the y-value in the long run? b) can you make any prediction about distant future y-values if you know the initial condition? reaching all these values is called having a dense orbit ... this is another definition of CHAOS (want to learn more? ... take a class on dynamics and chaos) © Jason Samuels 2008
© Copyright 2026 Paperzz