Yagami.CurtisGodson.QuadraturePointsType

A structure to hold quadrature points and weights for numerical integration. Where N is the number of quadrature points and T is the type of the points and weights.

source
Yagami.CurtisGodson.get_quadrature_pointsMethod
get_quadrature_points(_, n)

Get quadrature points and weights for numerical integration using Gauss-Legendre quadrature. The function returns a QuadraturePoints object containing the points and weights.

Arguments

  • T: Type of the quadrature points (default is Float64).
  • n: Number of quadrature points (must be positive).

Returns

A QuadraturePoints object with the quadrature points and weights.

source
Yagami.CurtisGodson.linintegral!Method
linintegral!(out, f, Q, t, p)

Compute the linear integral of a function f over the quadrature points Q scaled by a factor t. It is assumed that the integral starts at 0 and ends at t. The function uses the quadrature points and weights to evaluate the integral numerically. The function evaluates f at the quadrature points scaled by t, computes the dot product with the weights, and stores the result in the output array out. The function f needs to have the following signature:

f(points::AbstractVector{T}, p) where {T<:AbstractFloat}

where p is an optional parameter that can be passed to the function to account for additional parameters in the integral.

Arguments

  • out: An output array to store the results of the integral.
  • f: A function that takes a vector of points and an optional parameter p.
  • Q: A QuadraturePoints object containing the quadrature points and weights.
  • t: the end of the integral path, which is a vector of the same size as out.
  • p: An optional parameter passed to the function f. Can be a vector of the same size of out or a single value.

Returns

The output array with the computed linear integrals.

source
Yagami.CurtisGodson.linintegralMethod
linintegral(f, Q)
linintegral(f, Q, t)
linintegral(f, Q, t, p)

Compute the linear integral of a function f over the quadrature points Q scaled by a factor t. It is assumed that the integral starts at 0 and ends at t. The function uses the quadrature points and weights to evaluate the integral numerically. The function evaluates f at the quadrature points scaled by t, computes the dot product with the weights, and returns the result multiplied by t/2.

The function f needs to have the following signature:

f(points::AbstractVector{T}, p) where {T<:AbstractFloat}

where p is an optional parameter that can be passed to the function to account for additional parameters in the integral.

Arguments

  • f: A function that takes a vector of points and an optional parameter p.
  • Q: A QuadraturePoints object containing the quadrature points and weights.
  • t: the end of the integral path, which is a scalar value.
  • p: An optional parameter passed to the function f.

Returns

The computed linear integral as a scalar value.

source