Namespace: DotNumerics.ODE.Dopri5Assembly: DWSIM.MathOps.DotNumerics (in DWSIM.MathOps.DotNumerics.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public void Run(
int N,
IFAREN FCN,
ref double X,
ref double[] Y,
int offset_y,
double XEND,
double[] RTOL,
int offset_rtol,
double[] ATOL,
int offset_atol,
int ITOL,
ISOLOUT SOLOUT,
int IOUT,
ref double[] WORK,
int offset_work,
int LWORK,
ref int[] IWORK,
int offset_iwork,
int LIWORK,
double[] RPAR,
int offset_rpar,
int[] IPAR,
int offset_ipar,
ref int IDID
)
Public Sub Run (
N As Integer,
FCN As IFAREN,
ByRef X As Double,
ByRef Y As Double(),
offset_y As Integer,
XEND As Double,
RTOL As Double(),
offset_rtol As Integer,
ATOL As Double(),
offset_atol As Integer,
ITOL As Integer,
SOLOUT As ISOLOUT,
IOUT As Integer,
ByRef WORK As Double(),
offset_work As Integer,
LWORK As Integer,
ByRef IWORK As Integer(),
offset_iwork As Integer,
LIWORK As Integer,
RPAR As Double(),
offset_rpar As Integer,
IPAR As Integer(),
offset_ipar As Integer,
ByRef IDID As Integer
)
Request Example
View SourceParameters
- N Int32
-
DIMENSION OF THE SYSTEM
- FCN IFAREN
-
NAME (EXTERNAL) OF SUBROUTINE COMPUTING THE
VALUE OF F(X,Y):
SUBROUTINE FCN(N,X,Y,F,RPAR,IPAR)
DOUBLE PRECISION X,Y(N),F(N)
F(1)=... ETC.
- X Double
-
INITIAL X-VALUE
- Y Double
-
- offset_y Int32
-
- XEND Double
-
FINAL X-VALUE (XEND-X MAY BE POSITIVE OR NEGATIVE)
- RTOL Double
-
- offset_rtol Int32
-
- ATOL Double
-
- offset_atol Int32
-
- ITOL Int32
-
SWITCH FOR RTOL AND ATOL:
ITOL=0: BOTH RTOL AND ATOL ARE SCALARS.
THE CODE KEEPS, ROUGHLY, THE LOCAL ERROR OF
Y(I) BELOW RTOL*ABS(Y(I))+ATOL
ITOL=1: BOTH RTOL AND ATOL ARE VECTORS.
THE CODE KEEPS THE LOCAL ERROR OF Y(I) BELOW
RTOL(I)*ABS(Y(I))+ATOL(I).
- SOLOUT ISOLOUT
-
NAME (EXTERNAL) OF SUBROUTINE PROVIDING THE
NUMERICAL SOLUTION DURING INTEGRATION.
IF IOUT.GE.1, IT IS CALLED AFTER EVERY SUCCESSFUL STEP.
SUPPLY A DUMMY SUBROUTINE IF IOUT=0.
IT MUST HAVE THE FORM
SUBROUTINE SOLOUT (NR,XOLD,X,Y,N,CON,ICOMP,ND,
RPAR,IPAR,IRTRN)
DIMENSION Y(N),CON(5*ND),ICOMP(ND)
....
SOLOUT FURNISHES THE SOLUTION "Y" AT THE NR-TH
GRID-POINT "X" (THEREBY THE INITIAL VALUE IS
THE FIRST GRID-POINT).
"XOLD" IS THE PRECEEDING GRID-POINT.
"IRTRN" SERVES TO INTERRUPT THE INTEGRATION. IF IRTRN
IS SET .LT.0, DOPRI5 WILL RETURN TO THE CALLING PROGRAM.
IF THE NUMERICAL SOLUTION IS ALTERED IN SOLOUT,
SET IRTRN = 2
----- CONTINUOUS OUTPUT: -----
DURING CALLS TO "SOLOUT", A CONTINUOUS SOLUTION
FOR THE INTERVAL [XOLD,X] IS AVAILABLE THROUGH
THE FUNCTION
.GT..GT..GT. CONTD5(I,S,CON,ICOMP,ND) .LT..LT..LT.
WHICH PROVIDES AN APPROXIMATION TO THE I-TH
COMPONENT OF THE SOLUTION AT THE POINT S. THE VALUE
S SHOULD LIE IN THE INTERVAL [XOLD,X].
- IOUT Int32
-
SWITCH FOR CALLING THE SUBROUTINE SOLOUT:
IOUT=0: SUBROUTINE IS NEVER CALLED
IOUT=1: SUBROUTINE IS USED FOR OUTPUT.
IOUT=2: DENSE OUTPUT IS PERFORMED IN SOLOUT
(IN THIS CASE WORK(5) MUST BE SPECIFIED)
- WORK Double
-
ARRAY OF WORKING SPACE OF LENGTH "LWORK".
WORK(1),...,WORK(20) SERVE AS PARAMETERS FOR THE CODE.
FOR STANDARD USE, SET THEM TO ZERO BEFORE CALLING.
"LWORK" MUST BE AT LEAST 8*N+5*NRDENS+21
WHERE NRDENS = IWORK(5)
- offset_work Int32
-
- LWORK Int32
-
DECLARED LENGHT OF ARRAY "WORK".
- IWORK Int32
-
INTEGER WORKING SPACE OF LENGHT "LIWORK".
IWORK(1),...,IWORK(20) SERVE AS PARAMETERS FOR THE CODE.
FOR STANDARD USE, SET THEM TO ZERO BEFORE CALLING.
"LIWORK" MUST BE AT LEAST NRDENS+21 .
- offset_iwork Int32
-
- LIWORK Int32
-
DECLARED LENGHT OF ARRAY "IWORK".
- RPAR Double
-
- offset_rpar Int32
-
- IPAR Int32
-
- offset_ipar Int32
-
- IDID Int32
-
REPORTS ON SUCCESSFULNESS UPON RETURN:
IDID= 1 COMPUTATION SUCCESSFUL,
IDID= 2 COMPUT. SUCCESSFUL (INTERRUPTED BY SOLOUT)
IDID=-1 INPUT IS NOT CONSISTENT,
IDID=-2 LARGER NMAX IS NEEDED,
IDID=-3 STEP SIZE BECOMES TOO SMALL.
IDID=-4 PROBLEM IS PROBABLY STIFF (INTERRUPTED).
See Also