Feb 1, 2008 #1 mapi Mechanical Jan 30, 2007 53 0 0 US What is the algorithm of gradient? FX=gradient(F,x); FX(i)=(F(i+1)-f(i-1))/(x(i+1)-(i-1))?? How about FX(1) and the gradient at the last point? Thanks, Mapi
What is the algorithm of gradient? FX=gradient(F,x); FX(i)=(F(i+1)-f(i-1))/(x(i+1)-(i-1))?? How about FX(1) and the gradient at the last point? Thanks, Mapi
Feb 2, 2008 #2 SomptingGuy Automotive May 25, 2005 8,922 0 0 GB The first and last points are first order only. One is a foreward difference, the other a backward difference. All other points are (as you said) second order. - Steve Upvote 0 Downvote
The first and last points are first order only. One is a foreward difference, the other a backward difference. All other points are (as you said) second order. - Steve
Feb 2, 2008 Thread starter #3 mapi Mechanical Jan 30, 2007 53 0 0 US Thanks. I check it and it indeed is. Mapi Upvote 0 Downvote