Skip to content

Haar missing implementations #105

@edinvay

Description

@edinvay

#ScalingProjector cannot be defined by precision
#Next piece of code shows the problem

from vampyr import vampyr1d as vp
import matplotlib.pyplot as plt
import numpy as np

x_min = 0
x_max = 1
order = 0 #Haar order
precision = 10**(-10)

mra = vp.MultiResolutionAnalysis(box=[x_min, x_max], order=order)
P_eps = vp.ScalingProjector(mra, prec = precision) #projects only on zero scale

def f(x):
return np.sin( np.pi * x[0] )

f_eps = P_eps(f) #create a tree with only one node

print(f_eps)

x_vec = np.linspace(0, 0.9999, 1000)
f_plt = np.array([f([x]) for x in x_vec ])
f_eps_plt = np.array([f_eps([x]) for x in x_vec ])
plt.plot(x_vec, f_plt , "black") # one function to plot
plt.plot(x_vec, f_eps_plt , "blue") # one function to plot
plt.show()

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