How i can construct Algorithm for successive values of a function

조회 수: 1 (최근 30일)
zahid
zahid 2016년 2월 11일
댓글: zahid 2016년 2월 11일
Dear All,
  • Please help me to construct following algorithm
  • X0(initializing vector)
  • while (tol>e-4,iter<100)
  • k=0,1 2...until convergent;
  • compute f(Xk);% a nonlinear function
  • compute Sk=f(Xk+Sk)-f(Xk);
  • Xk=Xk+Sk;
  • tol=gradient (f(Xk));end
Here i am facing the problem that when suppose k=0 (iteration 1),how i can get f(X0+S0)in same iteration because this is the output of second iteration.My Problem is how i can calculate the difference f(Xk+Sk)-f(Xk).In general at kth iteration i need to find
  • f(Xk+Sk)-f(Sk)
  • where
  • f(Xk+Sk) is output that will be calcuated at (k+1)th iter
  • f(Xk) is output that will be calculated at kth iter.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 2월 11일
No, f(Xk+Sk) is not the output that will be calculated at the k+1'th iteration. It is the output of f when called upon the sum of Xk and Sk
You have the difficulty that you have not defined an initial value for Sk.
  댓글 수: 1
zahid
zahid 2016년 2월 11일
Sorry i did a mistake in writing this code please see now
  • X0(initializing vector)
  • while (tol>e-4,iter<100)
  • k=0,1 2...until convergent;
  • compute f(Xk);% a nonlinear function
  • Compute Sk % Newton step
  • compute R=f(Xk+Sk)-f(Xk);
  • Sk=RSk
  • Xk=Xk+Sk;
  • tol=gradient (f(Xk)); end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by