Feb 1, 2008 #1 mapi Mechanical Joined Jan 30, 2007 Messages 53 Location 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 Joined May 25, 2005 Messages 8,922 Location 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 Joined Jan 30, 2007 Messages 53 Location US Thanks. I check it and it indeed is. Mapi Upvote 0 Downvote