-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (19 loc) · 797 Bytes
/
main.py
File metadata and controls
29 lines (19 loc) · 797 Bytes
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
import numpy as np
from RBF import WeightsInterpolator
from templates.custom_plotly import custom
import plotly.graph_objects as go
weights = np.load("PartialDifferentialEquations/weights_matrix.npy")
center_points = np.load("PartialDifferentialEquations/center_points.npy")
Interpolator = WeightsInterpolator.WeightsInterpolator(center_points, weights, 0.2, "multiquadric")
# Interpolated data
x_interpol = np.linspace(0, 2, 50)
for i in np.arange(0, 1, 0.05):
t_interpol = np.full(x_interpol.shape, i)
u_interpol = Interpolator.interpolate(x_interpol, t_interpol)
# Plotting
fig = go.Figure(data=[go.Scatter(
x=x_interpol,
y=u_interpol
)])
fig.update_layout(template=custom, font_size=12, xaxis_range=[0, 2], yaxis_range=[-4, 4])
fig.show()