Return exact solution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_lcce), | intent(in) | :: | self | Integrand. |
||
real(kind=R_P), | intent(in) | :: | t | Time. |
||
real(kind=R_P), | intent(in), | optional | :: | t0 | Initial time. |
|
class(integrand_object), | intent(in), | optional | :: | U0 | Initial conditions. |
Exact solution.
pure function exact_solution(self, t, t0, U0) result(exact)
!< Return exact solution.
class(integrand_lcce), intent(in) :: self !< Integrand.
real(R_P), intent(in) :: t !< Time.
real(R_P), intent(in), optional :: t0 !< Initial time.
class(integrand_object), intent(in), optional :: U0 !< Initial conditions.
real(R_P), allocatable :: exact(:) !< Exact solution.
real(R_P) :: t0_ !< Initial time, local variable.
allocate(exact(1:1))
t0_ = 0._R_P ; if (present(t0)) t0_ = t0
exact(1) = (self%U0 + self%b / self%a) * exp(self%a * (t - t0_)) - self%b / self%a
endfunction exact_solution