Skip to content

replicating front-page example  #31

@jagunther

Description

@jagunther

Hi!

First of all: Thanks a lot for making your code available :)

I want to implement 1D Fourier-extension of some functions and came across this library last week. I did a fresh install of Julia and the FrameFun, BasisFunctions and DomainSets packages. The first thing I did was to run the example code from the front-page (I run it as a script from the command-line):

gr();

B = Fourier(61) → -1..1
D = -0.5..0.5
f = x->x
F = Fun(f,B,D)
                                                                                                                                                                    
plot(F,layout = 2)

p = plot!(F,f,subplot=2)
display(p)
readline()

However, contrary to the plot on the front-page, the resulting function is only plotted in the inner interval, see figure attached.
frontpage_code_result

I did the following to get the approximation on the whole interval:

gr();

B = Fourier(61) → -1..1
D = -0.5..0.5
f = x->x
F_ = Fun(f, B, D)
F = expansion(B, F_.coefficients)

plot(F,layout = 2)
p = plot!(F,f,subplot=2)
display(p)
readline()

with the result
frontpage_code_adapted_result

This looks better, but it is not the same result as I see on the front-page.

What do I need to change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions