This is still under construction 1. Change the calculation to 3D graphing mode MODE button; Graph mode select "3D" if not already selected 2. Enter z1=x^2-x*y+y^2 green diamond; y=; type in function 3. Store the starting position in [p,q]; the sto> key is to the left of #1 key 1 sto> p 0 sto> q Repeat: 4. Compute and store gradient information in a and b Hmmm... how do we do this perhaps derivative(z1(x,y),x)|x=p and y=q sto> a derivative(z1(x,y),y)|x=p and y=q sto> b 5. create the function g(t) z1(p-a*t,q-b*t) sto> g(t) 6. find critical points solve(derivative(g(t),t)=0,t) 7. Select the correct critical point store in m sto> m 8. Update p, q p-a*t|t=m sto> p q-b*t|t=m sto> q Doesn't quit work, well it works once but not to repeat Solve is the problem solve(t=4,t) gives t=4 and not 4 as expected right(solve(t=4,t)) or maybe zeros() Second approach 1. Change the calculation to 3D graphing mode MODE button; Graph mode select "3D" if not already selected 2. Enter z1=x^2-x*y+y^2 green diamond; y=; type in function 3. Intial values 1 sto> p 0 sto> q 1 sto> j 4 Create lists px, py put p into px[1] q into py[1] apps 6 3 select list name it px put 1 into r1c1 apps 6 3 select list name it py put 0 into r1c1 4. derivatives into fx, fy; Pu into lx, ly; define g(t) d(z1(x,y),x) sto> fx(x,y) d(z1(x,y),y) sto> fy(x,y) p-fx(p,q)*t sto> lx(t) q-fy(p,q)*t sto> ly(t) z1(lx(t),ly(t) sto> g(t) 5. Repeat px[j] sto> p py[j] sto> q # this next step requires a human, somethings there is only one zeros # other times there can be many zeros, in which case one must select # the desired zero. zeros(diff(g(t),t)) sto> s j+1 sto> j lx(s) sto> p ly(s) sto> q # ever so close, the change in p screws up q since ly changes How to use the TI-89 to do a two dimensional steepest decent. An aid to the big valley project. Strategy: To fill in a list/matrix/data with columns for x, y and z values where the next row will hold the next approximation. We will use a host of temperary variables t1, p1, q1, p2, q2 [Note: none of these are single letters -- this might be a good thing.] The function f will be stored in z1(x,y), fx(x,y), fy(x,y) will be the partials, lx(t), ly(t) will be the x and y coordinates of the Pu line from P=[p1,q1], t1 will be the location of the next local minimum. The variables p2 and q2 are needed to get the update of p1 and q1. Things that need to be done once d(z1(x,y),x) sto> fx(x,y) d(z1(x,y),y) sto> fy(x,y) p1-fx(p1,q1)*t sto> lx(t) q1-fy(p1,q1)*t sto> ly(t) z1(lx(t),ly(t) sto> g(t) Create a points table: Apps 6 # this is the data editor dialog box select `Data' and name the variable points. home button [This step may require z1 to be defined first: put 1 into c1, 0 into c2, into the square above c3 type enter name it z and when c3= appears type z1(c1,c2)] Things that change for every program green diamond y= and enter f(x,y) into z1 [x^2-x*y+y^2]. (If you don't have z1, go to mode and switch graph to 3D) home -- to put the initial point data into p2 and q2 (in our case 1 sto> p2, 0 sto> q2) 1 sto> j1 -- # not sure if this will work can't seem to store into points from the home screen? Something is special about q1, I can't seem to be able to use it.