-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_weight_functions.py
More file actions
49 lines (39 loc) · 1.93 KB
/
plot_weight_functions.py
File metadata and controls
49 lines (39 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
"""
Created on Wed May 6 14:55:08 2020
@author: Samuel A. Maloney
"""
import numpy as np
import matplotlib.pyplot as plt
from weightfunctions import *
# x = np.linspace(0,1,101)
x = np.linspace(-1,1,201)
##### Values #####
plt.plot(x, Bump()(np.abs(x)), label='bump')
plt.plot(x, Gaussian()(np.abs(x)), label='Gaussian')
plt.plot(x, QuinticSpline()(np.abs(x)), label='quintic')
plt.plot(x, SimpleQuinticSpline()(np.abs(x)), label='simpleQuintic')
plt.plot(x, QuarticSpline()(np.abs(x)), label='quartic')
plt.plot(x, CubicSpline()(np.abs(x)), label='cubic')
plt.plot(x, QuadraticSpline()(np.abs(x)), label='quadratic')
plt.plot(x, SimpleCubicSpline()(np.abs(x)), label='simpleCubic')
##### 1st Derivatives #####
# plt.plot(x, Bump().dw(np.abs(x))[1], label='bump')
# plt.plot(x, Gaussian().dw(np.abs(x))[1], label='Gaussian')
# plt.plot(x, QuinticSpline().dw(np.abs(x))[1], label='quintic')
# plt.plot(x, SimpleQuinticSpline().dw(np.abs(x))[1], label='simpleQuintic')
# plt.plot(x, QuarticSpline().dw(np.abs(x))[1], label='quartic')
# plt.plot(x, CubicSpline().dw(np.abs(x))[1], label='cubic')
# plt.plot(x, QuadraticSpline().dw(np.abs(x))[1], label='quadratic')
# plt.plot(x, SimpleCubicSpline().dw(np.abs(x))[1], label='simpleCubic')
##### 2nd Derivatives #####
# plt.plot(x, Bump().d2w(np.abs(x))[2], label='bump')
# plt.plot(x, Gaussian().d2w(np.abs(x))[2], label='Gaussian')
# plt.plot(x, QuinticSpline().d2w(np.abs(x))[2], label='quintic')
# plt.plot(x, SimpleQuinticSpline().d2w(np.abs(x))[2], label='simpleQuintic')
# plt.plot(x, QuarticSpline().d2w(np.abs(x))[2], label='quartic')
# plt.plot(x, CubicSpline().d2w(np.abs(x))[2], label='cubic')
# plt.plot(x, QuadraticSpline().d2w(np.abs(x))[2], label='quadratic')
# plt.plot(x, SimpleCubicSpline().d2w(np.abs(x))[2], label='simpleCubic')
plt.legend()
# plt.savefig(f"weight_functions_plot.svg", bbox_inches = 'tight', pad_inches = 0)