next up previous contents
Next: Interactive mode Up: Non-interactive mode Previous: Syntax

Example

\ Suppose we want to use lmitool to solve the problem presented in Section 2.2.1. Invoking
-->txt=lmitool('sf_sat','Q,Y','A,B,umax')
yields the output
--> txt  = 
 
!    To solve your problem, you need to                         !
!                                                               !
!1- edit file /usr/home/DrScilab/sf_sat.sci                     !
!                                                               !
!2- load (and compile) your functions:                          !
!                                                               !
!   getf('/usr/home/DrScilab/sf_sat.sci','c')                   !
!                                                               !
!3- Define A,B,umax and call sf_sat function:                   !
!                                                               !
!  [Q,Y]=sf_sat(A,B,umax)                                       !
!                                                               !
!To check the result, use [LME,LMI,OBJ]=sf_sat_eval(list(Q,Y))  !
and results in the creation of the file '/usr/home/curdir/sf_sat.sci' with the following content:
  function [Q,Y]=sf_sat(A,B,umax)
 // Generated by lmitool on Tue Feb 07 10:30:35 MET 1995
   
   Mbound = 1e3;
   abstol = 1e-10;
   nu = 10;
   maxiters = 100;
   reltol = 1e-10;
   options=[Mbound,abstol,nu,maxiters,reltol];
    
 ///////////DEFINE INITIAL GUESS BELOW
 Q_init=...
 Y_init=...
 /////////// 
  
 XLIST0=list(Q_init,Y_init)
 XLIST=lmisolver(XLIST0,sf_sat_eval,options)
 [Q,Y]=XLIST(:)
  
  
  
 /////////////////EVALUATION FUNCTION////////////////////////////
  
 function [LME,LMI,OBJ]=sf_sat_eval(XLIST)
 [Q,Y]=XLIST(:)
  
 /////////////////DEFINE LME, LMI and OBJ BELOW
 LME=...
 LMI=...
 OBJ=...
It is easy to see how a small amount of editing can do the rest!



Scilab Group