Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import sympy as sb | |
def Chebyshev(N): | |
P = [0]*(N+1) | |
P[0] = 1 | |
P[1] = x | |
for n in range(1,N): | |
P[n+1] = 2 * x*P[n] - P[n-1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import sympy as sb | |
# 森正武, "数値解析", 共立出版株式会社, 第2版, 2002. | |
# 4.12 ラグランジュ補間公式の標本点の分布 | |
# 等間隔な標本点の分布(P170 - P173) | |
def LagrangePolynomial(X,Y): | |
def l(j,N): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import sympy as sb | |
x = sb.Symbol('x') | |
def Chebyshev1st(N): | |
T = [0]*(N+1) | |
T[0] = 1 | |
T[1] = x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# x | |
Δx = 0.1 | |
X = 10.0 | |
xlm = [0, X] | |
x = collect(xlm[1]:Δx:xlm[2]) | |
I = length(x) | |
# y | |
Δy = 0.1 | |
Y = 10.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# x | |
X = 5.0 | |
xlm = [-X,X] | |
dx = 0.1 | |
x = xlm[1]:dx:xlm[2] | |
x_n = length(x) | |
# t | |
T = 50.0 | |
tlm = [0,T] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PyPlot | |
function motion(event) | |
x = event[:xdata] | |
y = event[:ydata] | |
ln[:set_data](x,y) | |
draw() | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PyPlot | |
using PyCall | |
@pyimport matplotlib.animation as anim | |
dx = 0.05 | |
xlm = [0, 2π] | |
x = collect(xlm[1]:dx:xlm[2]) | |
n = length(x) | |
y = sin.(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
from numba import jit | |
# Julia set | |
# https://en.wikipedia.org/wiki/Julia_set#Quadratic_polynomials | |
def motion(event): | |
if (event.xdata is None) or (event.ydata is None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
from numba import jit | |
# Julia set | |
# https://en.wikipedia.org/wiki/Julia_set#Quadratic_polynomials | |
@jit | |
def JuliaSet(N,Nx,Ny,z,c): |