-
Thank you very much for providing such a nice Julia's package. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
That's a good question, the computation of that kind of terms is not currently implemented, but it shouldn't be too difficult to add. Currently the computation of matrices such as is done by adding the integrals computed in-between spline knots Since, in each In more general cases as in your example, Gauss-Legendre quadratures won't give the exact result (since the integrand is no longer a polynomial), but I guess they can still give you a good approximation. You can take a look at the implementation. To modify the integrand, one would simply modify the following line: @inbounds A[i, j] += y * bi * bj by something like @inbounds A[i, j] += y * bi * bj / x^2 I will try to add a more generic implementation (also allowing to change the size of the quadrature) when I find the time. |
Beta Was this translation helpful? Give feedback.
-
Update: this will be easier to do after #82 is merged. In your example, you would do: using BSplineKit
B = BSplineBasis(...)
f(x) = 1/x^2
L = galerkin_matrix(f, B, (Derivative(0), Derivative(1))) One can also change the number of quadrature nodes to make sure that things converge. For example: L = galerkin_matrix(f, B, (Derivative(0), Derivative(1)); quadrature = Galerkin.gausslegendre(Val(8))) But l me know if you have any comments or if you find another approach. |
Beta Was this translation helpful? Give feedback.
-
Interestingly, if I solve the simple problem: I got the right answer for the following implementation of the second derivative:
But it doesn't work if I use the following implementation of the second derivative:
Here is the code: |
Beta Was this translation helpful? Give feedback.
-
First of all, I'm sorry for my lack of knowledge about B-Splines at the beginning of my discussions. is the problematic one. The reason is that the Garlekin matrix will not be Hermitian for this term and therefore the eigenvalues are complex. Perhaps, this problem can be circumvented if I use the collocation point method. What do you think about it? |
Beta Was this translation helpful? Give feedback.
Update: this will be easier to do after #82 is merged.
In your example, you would do:
One can also change the number of quadrature nodes to make sure that things converge. For example:
But l me know if you have any comments or if you find another approach.