-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
differentiation_matrix(p) for Chevbyshev2() returns negative of the original matrix in Julia 1.10.2. #8
Comments
The sign of the differentiation matrix depends on the order of the mesh points you use. Many texts use the domain +1 to -1 (i.e. decreasing) but I’ve used -1 to +1 (i.e. increasing) because it fits more naturally with the application I use it for (collocation for differential equations). You can see this by looking at the mesh points returned by the library. |
Thanks.
…On Mon, Mar 25, 2024 at 11:15 AM David Barton ***@***.***> wrote:
The sign of the differentiation matrix depends on the order of the mesh
points you use. Many texts use the domain +1 to -1 (i.e. decreasing) but
I’ve used -1 to +1 (i.e. increasing) because it fits more naturally with
the application I use it for (collocation for differential equations). You
can see this by looking at the mesh points returned by the library.
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK4NBY4Q4GBXSOK4OYAQEADYZ7TMHAVCNFSM6AAAAABFGCXH56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJXGUZTGNJWGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I can confirm now that the differentiation matrix is working.
Please can you elaborate on the signs of the differentiation matrix. What
are the signs on D^2, D^3, D^4 and D^6.
On Mon, 25 Mar 2024, 12:36 pm Rasheed Adetona, ***@***.***>
wrote:
… Thanks.
On Mon, Mar 25, 2024 at 11:15 AM David Barton ***@***.***>
wrote:
> The sign of the differentiation matrix depends on the order of the mesh
> points you use. Many texts use the domain +1 to -1 (i.e. decreasing) but
> I’ve used -1 to +1 (i.e. increasing) because it fits more naturally with
> the application I use it for (collocation for differential equations). You
> can see this by looking at the mesh points returned by the library.
>
> —
> Reply to this email directly, view it on GitHub
> <#8 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AK4NBY4Q4GBXSOK4OYAQEADYZ7TMHAVCNFSM6AAAAABFGCXH56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJXGUZTGNJWGY>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
The signs are consistent with the mesh provided. For example p = Chebyshev2{20}() # create a Chebyshev type 2 polynomial of order 20
x = nodes(p) # get the nodes
y = sinpi.(x) # generate y values at the nodes
D = differentiation_matrix(p) # get the differentiation matrix
@show -pi^2*sinpi.(x) ≈ (D^2)*y # check the second derivative matches the analytical version (true) |
The differentiation_matrix(p) for Chevbyshev2() returns negative of the original matrix in Julia 1.10.2. My barycentricinterpolaton.jl version is 0.1.3.
The result for D is negative of the matrix in textbook. See the example below
using BarycentricInterpolation
N=3
p = Chebyshev2{N}()
D=differentiation_matrix(p) # incorrect
D=-differentiation_matrix(p) # correct
The text was updated successfully, but these errors were encountered: