- #1

- 205

- 0

## Main Question or Discussion Point

There are two functions that I need help with:

http://www.maths.uq.edu.au/expokit/fortran/dgpadm.f

http://www.maths.uq.edu.au/expokit/fortran/dgchbv.f

The problem I'm having is that the arguments on the line DGPADM(....) don't match identically with the explanation. For example, H, ldh and m vs. m and H(ldh,m) not sure why there is a parenthesis. If someone could give me a simple example of acceptable parameters that I could try out,that would be greatly appreciated.

I understand what to put for ideg, m, t, but not so sure about wsp, ipiv , H or the others. For example, H is a matrix, so I guess it needs a matrix as an argument..... regardless could someone help me out here?! Thanks!

In the first case:

subroutine DGPADM( ideg,m,t,H,ldh,wsp,lwsp,ipiv,iexph,ns,iflag )

* ideg : (input) the degre of the diagonal Pade to be used.

* a value of 6 is generally satisfactory.

*

* m : (input) order of H.

*

* H(ldh,m) : (input) argument matrix.

*

* t : (input) time-scale (can be < 0).

*

* wsp(lwsp) : (workspace/output) lwsp .ge. 4*m*m+ideg+1.

*

* ipiv(m) : (workspace)

*

*>>>> iexph : (output) number such that wsp(iexph) points to exp(tH)

* i.e., exp(tH) is located at wsp(iexph ... iexph+m*m-1)

* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* NOTE: if the routine was called with wsp(iptr),

* then exp(tH) will start at wsp(iptr+iexph-1).

*

* ns : (output) number of scaling-squaring used.

*

* iflag : (output) exit flag.

* 0 - no problem

* <0 - problem

Second case:

subroutine DGCHBV( m, t, H,ldh, y, wsp, iwsp, iflag )

* m : (input) order of the matrix H

*

* t : (input) time-scaling factor (can be < 0).

*

* H(ldh,m): (input) argument matrix.

*

* y(m) : (input/output) on input the operand vector,

* on output the resulting vector exp(t*H)*y.

*

* iwsp(m) : (workspace)

*

* wsp : (workspace). Observe that a double precision vector of

* length 2*m*(m+2) can be used as well when calling this

* routine (thus avoiding an idle complex array elsewhere)

http://www.maths.uq.edu.au/expokit/fortran/dgpadm.f

http://www.maths.uq.edu.au/expokit/fortran/dgchbv.f

The problem I'm having is that the arguments on the line DGPADM(....) don't match identically with the explanation. For example, H, ldh and m vs. m and H(ldh,m) not sure why there is a parenthesis. If someone could give me a simple example of acceptable parameters that I could try out,that would be greatly appreciated.

I understand what to put for ideg, m, t, but not so sure about wsp, ipiv , H or the others. For example, H is a matrix, so I guess it needs a matrix as an argument..... regardless could someone help me out here?! Thanks!

In the first case:

subroutine DGPADM( ideg,m,t,H,ldh,wsp,lwsp,ipiv,iexph,ns,iflag )

* ideg : (input) the degre of the diagonal Pade to be used.

* a value of 6 is generally satisfactory.

*

* m : (input) order of H.

*

* H(ldh,m) : (input) argument matrix.

*

* t : (input) time-scale (can be < 0).

*

* wsp(lwsp) : (workspace/output) lwsp .ge. 4*m*m+ideg+1.

*

* ipiv(m) : (workspace)

*

*>>>> iexph : (output) number such that wsp(iexph) points to exp(tH)

* i.e., exp(tH) is located at wsp(iexph ... iexph+m*m-1)

* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* NOTE: if the routine was called with wsp(iptr),

* then exp(tH) will start at wsp(iptr+iexph-1).

*

* ns : (output) number of scaling-squaring used.

*

* iflag : (output) exit flag.

* 0 - no problem

* <0 - problem

Second case:

subroutine DGCHBV( m, t, H,ldh, y, wsp, iwsp, iflag )

* m : (input) order of the matrix H

*

* t : (input) time-scaling factor (can be < 0).

*

* H(ldh,m): (input) argument matrix.

*

* y(m) : (input/output) on input the operand vector,

* on output the resulting vector exp(t*H)*y.

*

* iwsp(m) : (workspace)

*

* wsp : (workspace). Observe that a double precision vector of

* length 2*m*(m+2) can be used as well when calling this

* routine (thus avoiding an idle complex array elsewhere)