GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing slicot.org — DAESolver - SLICOT Library Routine Documentation DAESolverSolver for Algebraic Differential Equations (driver)[Specification][Arguments][Method][References][Comments][Example]Purpose Interface for using a common entry point, DSblock compatible for defining Differential Algebraic Equations using several packages. The equations follow the form (CASE A): F(dx(t)/dt, x(t), u(t), p, t) = 0 y(t) = g(dx(t)/dx, x(t), u(t), p, t) for the most general model which can only be solved by DASSL and DASSPK. A restricted case can be solved with RADAU5, LSODI, LSOIBT, if the system is expressed as (CASE B): F(x(t), u(t), p, t)*dx(t)/dt = A(x(t), u(t), p, t) y(t) = g(dx(t)/dx, x(t), u(t), p, t) And finally, the GELDA package is able to solve DAEs with the expression (CASE C): F(u(t), p, t)*dx(t)/dt = A(u(t), p, t)*x(t) + E(u(t), p, t) The user must define the subroutines: DAEDF: F(dx(t)/dt, x(t), u(t), p, t) for CASES: A, B and C DAEDA: A(x(t), u(t), p, t) for CASES: B and C DAEDE: E(u(t), p, t) for CASES: C DAEOUT: g(dx(t)/dx, x(t), u(t), p, t) and the Jacobians (JACFX, JACFU, JACFP) if used. The interface adapts the structure to fit all the codesSpecification SUBROUTINE DAESolver(ISOLVER,CDAEDF_,CDAEDA_,CDAEDE_,CDAEOUT_, $ CJACFX_,CJACFU_,CJACFP_,CJACFXDOT_, $ NX, NY, NU, NP, TINI, TOUT, $ X, XDOTI, Y, U, P, $ IPAR, RPAR, RTOL, ATOL, $ IWORK, LIWORK, DWORK, LDWORK, $ IWARN, INFO) .. Scalar Arguments .. DOUBLE PRECISION TINI, TOUT INTEGER ISOLVER, IWARN, INFO, $ NX, NY, NU, NP, $ LDWORK, LIWORK CHARACTER*9 CDAEDF_, CDAEDA_,CDAEDE_, CDAEOUT_, $ CJACFX_, CJACFU_, CJACFP_, CJACFXDOT_, $ CDAEDF, CDAEDA,CDAEDE, CDAEOUT, $ CJACFX, CJACFU, CJACFP, CJACFXDOT .. Array Arguments .. DOUBLE PRECISION DWORK(LDWORK), RPAR(*), ATOL(*), RTOL(*) $ X(NX), XDOTI(NX), Y(NY), U(NU), P(NP) INTEGER IWORK(LIWORK), IPAR(*)Arguments Mode Parameters ISOLVER INTEGER Indicates the nonlinear solver packages to be used = 1: LSODI, = 2: LSOIBT, = 3: RADAU5, = 4: DASSL, = 5: DASPK, = 6: DGELDA.Input/Output Parameters DAEDF (input) EXTERNAL Evaluates the F(dx(t)/dt, x(t), u(t), p, t). DAEDA (input) EXTERNAL Evaluates the A(x(t), u(t), p, t). DAEDE (input) EXTERNAL Evaluates the E(u(t), p, t). DAEOUT (input) EXTERNAL Evaluates the output signals function g. JACFX (input) EXTERNAL Evaluates the jacobian matrix with respect to X. JACFU (input) EXTERNAL Evaluates the jacobian matrix with respect to U. JACFP (input) EXTERNAL Evaluates the jacobian matrix with respect to P. NX (input) INTEGER Dimension of the state vector. NY (input) INTEGER Dimension of the output vector. NU (input) INTEGER Dimension of the input vector. NP (input) INTEGER Dimension of the parameter vector. TINI (input) DOUBLE PRECISION Initial value of time. TOUT (input) DOUBLE PRECISION Final value of time. X (input/output) DOUBLE PRECISION array, dimension (NX) On entry, array containing the initial state variables. On exit, it has the last value of the state variables. XDOTI (input) DOUBLE PRECISION array, dimension (NX) Array containing dx(t)/dt at initial point. Y (input/output) DOUBLE PRECISION array, dimension (NY) On entry, array containing the initial values of Y. On exit, it has the results of the system. U (input) DOUBLE PRECISION array, dimension (NU) Array containing the input initial values. P (input) DOUBLE PRECISION array, dimension (NP) Array containing the parameter variables. IPAR (input/output) INTEGER array, dimension (201) INPUT: 1..15 General 16..25 ODEPACK 26..35 RADAU5 36..50 DASSL/PK 51..60 GELDA 61..100 Reserved OUTPUT: 101..110 General 111..125 ODEPACK 126..135 RADAU5 136..145 DASSL/PK 146..155 GELDA 156..200 Reserved Any Mode: 201.. User Available Common integer parameters for SOLVERS: IPAR(1), Tolerance mode 0 : both rtol and atol are scalars 1 : rtol is a scalar and atol is a vector 2 : both rtol and atol are vectors IPAR(2), Compute Output Values only at TOUT (and not at the intermediate step). (1:Yes, 0:No) IPAR(3), mfjac, Method flag for jacobian 0 : No jacobian used (non-stiff method). 1 : User supplied full jacobian (stiff). 2 : User supplied banded jacobian (stiff). 3 : User supplied sparse jacobian (stiff). 10 : internally generated full jacobian (stiff). 11 : internally generated banded jacobian (stiff). 12 : internally generated sparse jacobian (stiff). IPAR(6), ml, lower half-bandwithds of the banded jacobian, excluding tne main diagonal. IPAR(7), mu, upper half-bandwithds of the banded jacobian, excluding the main diagonal. (Note: IPAR(6) and IPAR(7) are obligatories only if the jacobian matrix is banded) IPAR(101) = Number of steps taken for the problem. IPAR(102) = Number of residual evaluations. IPAR(103) = Number of jacobian evaluations. Common parameters for RADAU5, ODEPACK and DGELDA: IPAR(9), mfmass, Method flag for mass-matrix 0 : No mass-matrix used (non-stiff method). 1 : User supplied full mass-matrix (stiff). 2 : User supplied banded mass-matrix (stiff). 10 : Identity mass-matrix is used (stiff). IPAR(10), mlmass, lower half-bandwithds of the banded mass matrix, excluding the main diagonal. IPAR(11), mumass, upper half-bandwithds of the banded mass matrix, excluding the main diagonal. IPAR(12), Maximum number of steps allowed during one call to the solver. Common parameters for ODEPACK, DASSL, DASPK and DGELDA: IPAR(13), Maximum order to be allowed. default values : 12 if meth = 1 5 if meth = 2 If exceds the default value, it will be reduced to the default value. In DASSL, DASPK and DGELDA : (1 .LE. MAXORD .LE. 5) IPAR(111) = The method order last used(successfully). IPAR(112) = The order to be attempted on the next step. Common parameters for ODEPACK package: IPAR(16), Status Flag IPAR(17), Optional inputs, must be 0 IPAR(18), Maximum number of messages printed, default value is 10. IPAR(113) = Index of the component of largest in the weighted local error vector ( e(i)/ewt(i) ). IPAR(114) = Length of rwork actually required. IPAR(115) = Length of iwork actually required. - LSOIBIT IPAR(24), mb, block size. (mb .GE. 1) and mb*IPAR(28) = NX IPAR(25), nb, number of blocks in the main diagonal. (nb .ge. 4) and nb*IPAR(27) = NX - RADAU5 IPAR(26) Transforms the Jacobian matrix to Hessenberg form.(Only if IPAR(9)=1 and IPAR(3)=1 or 10) IPAR(27) Maximum number of Newton iterations in each step. IPAR(28) Starting values for Newton's method .EQ. 0 -> is taken the extrapolated collocation solution .NE. 0 -> zero values are used. IPAR(29) Dimension of the index 1 variables( >0 ). IPAR(30) Dimension of the index 2 variables. IPAR(31) Dimension of the index 3 variables. IPAR(32) Switch for step size strategy 0,1 Mod. Predictive controller(Gustafsson) 2 Classical step size control IPAR(33) Value of M1 (default 0). IPAR(34) Value of M2 (default(M2=M1). IPAR(126), Number of accepted steps. IPAR(127), Number of rejected steps. IPAR(128), Number of LU-Decompositions of both matrices IPAR(129), Number of forward-backward substitutions, of both systems. Common parameters for DASSL, DASPK and DGELDA solvers: IPAR(36), this parameter enables the code to initialize itself. Must set to 0 to indicate the start of every new problem. 0: Yes. (On each new problem) 1: No. (Allows 500 new steps) IPAR(38), Solver try to compute the initial T, X and XPRIME: 0: The initial T, X and XPRIME are consistent. 1: Given X_d calculate X_a and X'_d 2: Given X' calculate X. ( X_d differential variables in X X_a algebrac variables in X ) IPAR(136), Total number of error test failures so far. Common parameters for DASSL and DASPK solvers: IPAR(37), code solve the problem without invoking any special non negativity constraints: 0: Yes 1: To have constraint checking only in the initial condition calculation. 2: To enforze nonnegativity in X during the integration. 3: To enforce both options 1 and 2. IPAR(137), Total number of convergence test failures. - DASPK IPAR(39), DASPK use: 0: direct methods (dense or band) 1: Krylov method (iterative) 2: Krylov method + Jac (iterative) IPAR(41), Proceed to the integration after the initial condition calculation is done. Used when IPAR(38) > 0: 0: Yes 1: No IPAR(42), Errors are controled localy on all the variables: 0:Yes 1: No IPAR(8), Extra printing 0, no printing 1, for minimal printing 2, for full printing IPAR(44), maximum number of iterations in the SPIGMR algorithm. (.LE. NX) IPAR(45), number of vectors on which orthogonalization is done in the SPIGMR algorithm. (.LE. IPAR(44)) IPAR(46), maximum number of restarts of the SPIGMR algorithm per nonlinear iteration. (.GE. 0) IPAR(47), maximum number of Newton iterations per Jacobian or preconditioner evaluation. (> 0) IPAR(48), maximum number of Jacobian or preconditioner evaluations. (> 0) IPAR(49), maximum number of values of the artificial stepsize parameter H to be tried if IPAR(38) = 1. (> 0). IPAR(50), flag to turn off the linesearch algorithm. 0 : ON 1 : OFF (default) IPAR(138), number of convergence failures of the linear iteration IPAR(139), length of IWORK actually required. IPAR(140), length of RWORK actually required. IPAR(141), total number of nonlinear iterations. IPAR(142), total number of linear (Krylov) iterations IPAR(143), number of PSOL calls. - DGELDA IPAR(51), contains the strangeness index. IPAR(52), number of differential components IPAR(53), number of algebraic components IPAR(54), number of undetermined components IPAR(55), method used: if 1 then uses the BDF solver 2 then uses the Runge-Kutta solver IPAR(56), E(t) and A(t) are: 1 time dependent 0 constants IPAR(57), Maximum index of the problem. ( .GE. 0 ) IPAR(58), Step size strategy: 0, Mod. predictive controlled of Gustafsson(safer) 1, classical step size control(faster) RPAR (input/output) DOUBLE PRECISION array, dimension (201) INPUT: 1..15 General 16..25 ODEPACK 26..35 RADAU5 36..50 DASSL/PK 51..60 GELDA 61..100 Reserved OUTPUT: 101..110 General 111..125 ODEPACK 126..135 RADAU5 136..145 DASSL/PK 146..155 GELDA 156..200 Reserved Any Mode: 201.. User Available Common parameters for solvers: RPAR(1), Initial step size guess.Obligatory in RADAU5. RPAR(2), Maximum absolute step size allowed. Common parameters for ODEPACK, DASSL, DASPK and DGELDA: RPAR(111), Step size in t last used (successfully). RPAR(112), Step size to be attempted on the next step. RPAR(113), Current value of the independent variable which the solver has actually reached Common parameters for ODEPACK solver: RPAR(16), Critical value of t which the solver is not overshoot. RPAR(17), Minimum absolute step size allowed. RPAR(18), Tolerance scale factor, greater than 1.0. Parameters for RADAU5 solver: RPAR(26), The rounding unit, default 1E-16. RPAR(27), The safety factor in step size prediction, default 0.9D0. RPAR(28), Decides whether the jacobian should be recomputed, default 0.001D0. Increase when jacobian evaluations are costly For small systems should be smaller. RPAR(29), Stopping criterion for Newton's method, default MIN(0.03D0, RTOL(1)**0.5D0). RPAR(30), RPAR(31): This saves, together with a large RPAR(28), LU-decompositions and computing time for large systems. Small systems: RPAR(30)=1.D0, RPAR(31)=1.2D0 Large full systems: RPAR(30)=0.99D0, RPAR(31)=2.D0 might be good. RPAR(32), RPAR(33), Parameters for step size selection.Condition: RPAR(32)<=HNEW/HOLD<=RPAR(33) Parameters for DASSL, DASPK and DGELDA solvers: RPAR(36), Stopping point (Tstop) - DASPK RPAR(37), convergence test constant in SPIGMR algorithm. (0 .LT. RPAR(37) .LT. 1.0) RPAR(38), minimum scaled step in linesearch algorithm. The default is = (unit roundoff)**(2/3). (> 0) RPAR(39), swing factor in the Newton iteration convergence test. (default 0.1) (> 0) - DASPK RPAR(40), safety factor used in step size prediction. RPAR(41) and RPAR(42) restric the relation between the new and old stepsize in step size selection. 1/RPAR(41) .LE. Hnew/Hold .LE. 1/RPAR(42) RPAR(43), RPAR(44) QUOT1 and QUOT2 repectively. If QUOT1 < Hnew/Hold < QUOT2 and A and E are constants, the work can be saved by setting Hnew=Hold and using the system matrix of the previous step.Tolerances RTOL DOUBLE PRECISION Relative Tolerance. ATOL DOUBLE PRECISION Absolute Tolerance.Workspace IWORK INTEGER array, dimension (LIWORK) LIWORK INTEGER Minimum size of DWORK, depending on solver: - LSODI, LSOIBT, DASSL 20 + NX - RADAU5 3*N+20 DWORK DOUBLE PRECISION array, dimension (LDWORK) LDWORK INTEGER Size of DWORK, depending on solver: - LSODI 22 + 9*NX + NX**2 , IPAR(3) = 1 or 10 22 + 10*NX + (2*ML + MU)*NX , IPAR(3) = 2 or 11 - LSOIBT 20 + nyh*(maxord + 1) + 3*NX + lenw where nyh = Initial value of NX maxord = Maximum order allowed(default or IPAR(13) lenw = 3*mb*mb*nb + 2 - RADAU5 N*(LJAC+LMAS+3*LE+12)+20 where LJAC=N if (full jacobian) LJAC=MLJAC+MUJAC+1 if (banded jacobian) and LMAS=0 if (IPAR(9) = 10 or 11) LMAS=N if (IPAR(9) = 1) LMAS=MLMAS+MUMAS+1 if (IPAR(9) = 2) and LE=N if (IPAR(9) = 1 or 10) LE=2*MLJAC+MUJAC+1 if (IPAR(9) = 2 or 11) - DASSL >= 40 LRW .GE. 40+(MAXORD+4)*NEQ+NEQ**2, IPAR(3) = 1 or 10 >= 40+(MAXORD+4)*NEQ+(2*ML+MU+1)*NEQ, IPAR(3) = 2 >= 40+(MAXORD+4)*NEQ+(2*ML+MU+1)*NEQ +2*(NEQ/(ML+MU+1)+1), IPAR(3) = 11Warning Indicator IWARN INTEGER = 0: no warning; = 1: LSODI/LSOIBT/RADAU5 do not use the input vector as argument; = 2: LSODI/LSOIBT do not use the param vector as argument; = 3: RTOL and ATOL are used as scalars;Error Indicator INFO INTEGER = 0: Successful exit; < 0: If INFO = -i, the i-th argument had an illegal value; = 1: Wrong tolerance mode; = 2: Method (IPAR(9)) is not allowed for ODEPACK/RADAU5; = 3: Method (IPAR(3)) is not allowed for LSODE/RADAU5/DASSL; = 4: Option not allowed for IPAR(37); = 5: Option not allowed for IPAR(38); = 100+ERROR: RADAU5 returned -ERROR; = 200+ERROR: DASSL returned -ERROR; = 300+ERROR: DASPK returned -ERROR; = 400+ERROR: DGELDA returned -ERROR.Method Since the package integrates 8 different solvers, it is possible to solve differential equations by means of Backward Differential Formulas, Runge-Kutta, using direct or iterative methods (including preconditioning) for the linear system associated, differential equations with time-varying coefficients or of order higher than one. The interface facilitates the user the work of changing the integrator and testing the results, thus leading a more robust and efficient integrated package.References [1] A.C. Hindmarsh, Brief Description of ODEPACK: A Systematized Collection
of ODE Solvers, http://www.netlib.org/odepack/doc
[2] L.R. Petzold DASSL Library Documentation, http://www.netlib.org/ode/
[3] P.N. Brown, A.C. Hindmarsh, L.R. Petzold, DASPK Package 1995 Revision
[4] R.S. Maier, Using DASPK on the TMC CM5. Experiences with Two Programming
Models, Minesota Supercomputer Center, Technical Report.
[5] E. Hairer, G. Wanner, Solving Ordinary Dirential Equations II. Stiánd
Dirential- Algebraic Problems., Springer Seried in Computational
Mathermatics 14, Springer-Verlag 1991, Second Edition 1996.
[6] P. Kunkel, V. Mehrmann, W. Rath und J. Weickert, `GELDA: A Software
Package for the Solution of General Linear Dirential Algebraic
equations', SIAM Journal Scienti^Lc Computing, Vol. 18, 1997, pp.
115 - 138.
[7] M. Otter, DSblock: A neutral description of dynamic systems.
Version 3.3, http://www.netlib.org/odepack/doc
[8] M. Otter, H. Elmqvist, The DSblock model interface for exchanging model
components, Proceedings of EUROSIM 95, ed. F.Brenenecker, Vienna, Sep.
11-15, 1995
[9] M. Otter, The DSblock model interface, version 4.0, Incomplete Draft,
http://dv.op.dlr.de/~otter7dsblock/dsblock4.0a.html
[10] Ch. Lubich, U. Novak, U. Pohle, Ch. Engstler, MEXX - Numerical
Software for the Integration of Constrained Mechanical Multibody
Systems, http://www.netlib.org/odepack/doc
[11] Working Group on Software (WGS), SLICOT Implementation and Documentation
Standards (version 1.0), WGS-Report 90-1, Eindhoven University of
Technology, May 1990.
[12] P. Kunkel and V. Mehrmann, Canonical forms for linear differential-
algebraic equations with variable coeÆcients., J. Comput. Appl.
Math., 56:225{259, 1994.
[13] Working Group on Software (WGS), SLICOT Implementation and Documentation
Standards, WGS-Report 96-1, Eindhoven University of Technology, updated:
Feb. 1998, ../../REPORTS/rep96-1.ps.Z.
[14] A. Varga, Standarization of Interface for Nonlinear Systems Software
in SLICOT, Deutsches Zentrum ur Luft un Raumfahrt, DLR. SLICOT-Working
Note 1998-4, 1998, Available at
../../REPORTS/SLWN1998-4.ps.Z.
[15] D. Kirk, Optimal Control Theory: An Introduction, Prentice-Hall.
Englewood Cli, NJ, 1970.
[16] F.L. Lewis and V.L. Syrmos, Optimal Control, Addison-Wesley.
New York, 1995.
[17] W.M.Lioen, J.J.B de Swart, Test Set for Initial Value Problem Solvers,
Technical Report NM-R9615, CWI, Amsterdam, 1996.
http://www.cwi.nl/cwi/projects/IVPTestset/.
[18] V.Hernandez, I.Blanquer, E.Arias, and P.Ruiz,
Definition and Implementation of a SLICOT Standard Interface and the
associated MATLAB Gateway for the Solution of Nonlinear Control Systems
by using ODE and DAE Packages}, Universidad Politecnica de Valencia,
DSIC. SLICOT Working Note 2000-3: July 2000. Available at
../../REPORTS/SLWN2000-3.ps.Z.
[19] J.J.B. de Swart, W.M. Lioen, W.A. van der Veen, SIDE, November 25,
1998. Available at http://www.cwi.nl/cwi/projects/PSIDE/.
[20] Kim, H.Young, F.L.Lewis, D.M.Dawson, Intelligent optimal control of
robotic manipulators using neural networks.
[21] J.C.Fernandez, E.Arias, V.Hernandez, L.Penalver, High Performance
Algorithm for Tracking Trajectories of Robot Manipulators,
Preprints of the Proceedings of the 6th IFAC International Workshop on
Algorithms and Architectures for Real-Time Control (AARTC-2000),
pages 127-134.
Numerical Aspects
The numerical aspects of the routine lie on the features of the different packages integrated. Several packages are more robust than others, and other packages simply cannot deal with problems that others do. For a detailed description of the numerical aspects of each method is recommended to check the references above.Further Comments Several packages (LSODES, LSOIBT) deal only with sparse matrices. The interface checks the suitability of the methods to the parameters and show a warning message if problems could arise.Example Program Text
* DAESOLVER EXAMPLE PROGRAM TEXT FOR LSODIX
PROBLEM
SUBROUTINE TEST( ISOLVER )
IF ( TYPE.NE.'DAE' ) THEN
CALL DAESolver(
ISOLVER, CDAEDF, CDAEDA, CDAEDE, CDAEOUT,
SUBROUTINE DAEDA_( RPAR, NRP, IPAR,
NIP, X, NX, U, NU, P, NP,
SUBROUTINE DAEDF_( RPAR, NRP, IPAR,
NIP, X, XPRIME, NX,
SUBROUTINE JACFX_( NRP, NIP,
RPAR, IPAR, NX, NU,
SUBROUTINE JACFXDOT_( NRP, NIP, RPAR,
IPAR,
Program Data No data requiredProgram Results DAESOLVER EXAMPLE PROGRAM RESULTS Problem: LSODIX Solver: LSODI lsodix (lsodix , DAE) with SOLVER 1 IWARN on exit from DAESolver = 2 Solution: (calculated) (reference) 6.462112224297606E-07 1.255974374648338E-10 6.117680951077711E-07 Relative error comparing with the reference solution: .8898590685949503E-06 |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |