next up previous
Next: Simulation Up: Introduction to SCILAB Previous: On line definition of

Optimization

Let us define the 2D Rosenbrock test function.
-->deff('[f,g,ind]=rosenbro(x,ind)', [
-->           'a=x(2)-x(1)^2 , b=1-x(2)'
-->           'f=100.*a^2 + b^2 ,'
-->           'g(1)=-400.*x(1)*a ,'
-->           'g(2)=200.*a -2.*b ']);
Get the minimal point using quasi-newton method
-->[f,x,g]=optim(rosenbro,[2;2],'qn')
 g  =
!   0. !
!   0. !
 x  =
!   1. !
!   1. !
 f  =
    0.


Scilab group