Python: https://www.python.org/downloads/
Jupyter: https://jupyter.org/install
Sympy: https://docs.sympy.org/latest/tutorial/preliminaries.html#installation
Anaconda: https://www.anaconda.com/distribution/
OpenCL: https://www.khronos.org/opencl/
from sympy import *
from sympy.plotting import plot
from sympy.plotting import plot3d
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = 10, 10
init_printing()x, y, a, b, c, n, i = symbols('x y a b c n i')integrate(x*cos(x**2))sqrt(8).evalf(3000)pipi.evalf(1000)exp(1)exp(1).evalf(100)Sum(i, (i, 0, n))summation = Sum(i, (i, 0, n))summation.subs(n, 10).evalf()factorial(x)factorial(100)(x+y)**2expand((x+y)**2)expand((x+y)**3)expand((x+y)**4)expand((x+y)**5)expand((x+y)**6)expand((x+y)**20)a*x ** 2 + b * x + csolve(a * x ** 2 + b * x + c, x)solve(x**2 + ln(y), y)integrate(x/(x**2+1))diff(x/(x**2+1))Integral(x/(x**2+1), x)f = Integral(x/(x**2+1),(x,0,exp(2)))ff.doit()f.doit().evalf(20)scale = 4.0
scaleTransform = Matrix([[scale, 0, 0],[0, scale, 0],[0, 0, scale]])
coord = Matrix([1, 2, 3])
transform = scaleTransform * coordtransformrotation = 45
rotationTransform = Matrix([[1, 0, 0], [0, cos(rotation), -sin(rotation)], [0, sin(rotation), cos(rotation)]])
rotationTransform * transform_.evalf(10)f = Function('f')dsolve(Derivative(f(x), x, x) + 9*f(x), f(x))eq = sin(x)*cos(f(x)) + cos(x)*sin(f(x))*f(x).diff(x)dsolve(eq)dsolve(eq, hint='1st_exact')p = plot(x*x)plot(cos(x))<sympy.plotting.plot.Plot at 0x7f17d0a26550>
plot(log(x), x, log(x)*x, x**2, 2**x, factorial(x), (x, 1, 5))<sympy.plotting.plot.Plot at 0x7f17d09a3710>
plot3d(sin(x**2+y**2), (x, -2, 2), (y, -2, 2))<sympy.plotting.plot.Plot at 0x7f17d0891490>
plot3d(sin(x) * cos(y), (x, -2* pi, 2 * pi), (y, -2 * pi, 2 * pi))<sympy.plotting.plot.Plot at 0x7f17d07f9790>
plot3d((sin(x) * cos(y))/5, (x, -2*pi, 2*pi), (y, -2*pi, 2*pi))<sympy.plotting.plot.Plot at 0x7f17c8617790>
import numpy as np
from matplotlib import pyplot as plt
def diff(x1,y1):
return y1/x1
x1 = np.linspace(-10,10,50)
y1 = np.linspace(-10,10,50)
for j in x1:
for k in y1:
slope = diff(j,k)
domain = np.linspace(j-0.07,j+0.07,2)
def fun(x2,y2):
z = slope*(domain-x2)+y2
return z
plt.plot(domain,fun(j,k),solid_capstyle='projecting',solid_joinstyle='bevel')
plt.title("Slope field y'")
plt.grid(True)
plt.show()
print("End of line")End of line
This talk is on GitHub






