ortho.OrthogonalFunctions#
- class ortho.OrthogonalFunctions(start_index=1, num_func=9, end_interval=1, verbose=False)#
Generates a set of orthonormal functions.
- Parameters:
- start_indexint, default=1
The index of the starting function, \(i_0\).
- num_funcint, default=9
Number of orthogonal functions to generate
- end_intervalfloat, default=1
The right interval of orthogonality, \(L\).
- veboseboolean, default=False
Prints the generated functions. An example of output is
phi_1(t) = sqrt(x) phi_2(t) = sqrt(6)*(5*x**(1/3) - 6*sqrt(x))/3 phi_3(t) = sqrt(2)*(21*x**(1/4) - 40*x**(1/3) + 20*sqrt(x))/2
Notes
The orthogonal functions, \(\phi_i^{\perp}\), are generated based on the set of non-orthonormal functions \(\phi_i\) defined by the inverse-monomials
\[\phi_i(t) = t^{\frac{1}{i+1}}, \qquad i = i_0,\dots,i_0+n.\]The orthonormalized functions \(\phi_i^{\perp}\) are the linear combination of the functions \(\phi_i\) by
\[\phi_i^{\perp}(t) = \alpha_i \sum_{j = i_0}^{i_0+n} a_{ij} \phi_j(t), \qquad i = i_0,\dots,i_0+n.\]The functions \(\phi_i^{\perp}\) are orthonormal in the interval \(t \in [0,L]\) with respect to the weight function \(w(t) = t^{-1}\). That is,
\[\langle \phi_i^{\perp},\phi_j^{\perp} \rangle_{L^2([0,L], \mathrm{d}t/t)} = \int_0^L \phi_i^{\perp}(t) \phi_j^{\perp}(t) \frac{\mathrm{d}t}{t} = \delta_{ij},\]where \(\delta_{ij}\) is the Kronecker delta function. The orthogonal functions are generated by Gram-Schmidt orthogonalization process.
- Attributes:
- sym_phisympy obj
Orthogonal functions \(\phi_i^{\perp}\)
- sym_alphasympy obj
Coefficients \(\alpha_i\)
- sym_coeffssympy obj
Coefficients \(a_{i,j}\)
- alphalist
Coefficients \(\alpha_i\)
- coeffslist of lists
Coefficients \(a_{i,j}\)
Methods
check
([verbose])Check the mutual orthogonality of the functions.
print
()Print coeffs of Functions.
plot
([filename])Plot the generated functions.