hmwk2 - function. Note that to have access to this plotting...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Department of Chemical Engineering University of California, Santa Barbara Eng 5A Fall 2001 Instructor: David Pine Homework #2 Homework due: Wednesday, 10 October 2001 Reading: Mathematica Primer Chapters 3 1. (a) Use Mathematica to plot the slope (direction) field for the following nonlinear, first order ODE: dy dx = 6 - 4 x y 3 + y + 4 A convenient range to use is - 1 < x < 4 and - 3 < y < 2. (b) Using NDSolve , generate a particular solution to this ODE that satisfies the initial condition y (0) = 1. Overlay this solution on the slope field. (c) Solve this same initial value (IV) problem analytically by separating variables and integrating. After integrating, you will note that you cannot explicitly express your result in the form y = f ( x ), but instead will have a so-called implicit solution. Thus, to plot your result, you will need to use Mathematica’s ImplicitPlot
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: function. Note that to have access to this plotting function, you will first have to load the appropriate Math-ematica graphics package by executing the command <<Graphics ` ImplicitPlot `. For a demonstration of using this function, look under ImplicitPlot in the Master Index under the Help menu in Mathematica . 2. Using Mathematica , implement Euler’s method to numerically solve: dy dx = 3 x-y, y (0) = 1 over the x interval (0 , 2). In your first attempt, use a step size of h = 0 . 2. The find the solution again using a step size half as large. Compare your numerical solutions with a solution obtained using NDSolve by overlaying the three solutions on the same plot. Refer to Demo 4 on the class web site for guidance in solving this problem....
View Full Document

This note was uploaded on 12/29/2011 for the course ENGR 5a taught by Professor Brewer during the Fall '09 term at UCSB.

Ask a homework question - tutors are online