LobattoMonomialExpansionAll
Returns all the monomial expansion of all Lobatto polynomials.
Interface
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION LobattoMonomialExpansionAll(n) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
REAL(DFP) :: ans(1:n + 1, 1:n + 1)
END FUNCTION LobattoMonomialExpansionAll
END INTERFACE
- n : is the order of the polynomial
- ans(:,i) contains the coefficient of monomials for polynomial order=i-1
for example, n=5, we have the following structure of ans.
P0 | P1 | P2 | P3 | P4 | P5 |
---|---|---|---|---|---|
1 | 0 | -0.5 | -0 | 0.375 | 0 |
0 | 1 | 0 | -1.5 | -0 | 1.875 |
0 | 0 | 1.5 | 0 | -3.75 | -0 |
0 | 0 | 0 | 2.5 | 0 | -8.75 |
0 | 0 | 0 | 0 | 4.375 | 0 |
0 | 0 | 0 | 0 | 0 | 7.875 |
This example shows the usage of LobattoMonomialExpansionAll
method.
This routine returns the monomial expansion.
program main
use easifembase
implicit none
integer( i4b ) :: n
real( dfp ), allocatable :: coeff(:, :)
type(string) :: astr
n = 5; call callme
contains
subroutine callme
coeff=LobattoMonomialExpansionAll( n=n )
astr = MdEncode( coeff )
call display( astr%chars(), "" )
end subroutine callme
end program main
P0 | P1 | P2 | P3 | P4 | P5 |
---|---|---|---|---|---|
0.5 | 0.5 | -0.61237 | -0 | 0.23385 | 0 |
-0.5 | 0.5 | 0 | -0.79057 | -0 | 0.7955 |
0 | 0 | 0.61237 | 0 | -1.4031 | -0 |
0 | 0 | 0 | 0.79057 | 0 | -2.6517 |
0 | 0 | 0 | 0 | 1.1693 | 0 |
0 | 0 | 0 | 0 | 0 | 1.8562 |