BÔ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC THƯƠNG MẠI KHOA HỆ THỐNG THÔNG TIN KINH TẾ & THƯƠNG MẠI ĐIỆN TỬ BẢN BÁO CÁO TỔNG HỢP HỌC PHẦN TOÁN CAO CẤP Nhiệm vụ: “Sử dụng Python để giải tốn” Lớp học phần: 2192FMAT0211 Nhóm thực hiện: 03 Giảng viên giảng dạy: Lê Văn Tuấn HÀ NỘI – 2021 TIEU LUAN MOI download : skknchat123@gmail.com DANH SÁCH THÀNH VIÊN NHĨM 03 – LỚP HP: 2192FMAT0211 Nhóm trưởng: Lê Thị Giang ST Họ tên T 21 Đinh Thùy Dương 22 Nguyễn Hưng Duy 23 Lê Thị Giang 24 Nguyễn Thị Hương Giang 25 Nguyễn Thu Hà 26 Trần Thị Hà 27 Nguyễn Thị Hằng 28 Nguyễn Thị Thúy Hằng 29 Nguyễn Thúy Hằng 30 Trần Thị Thu Hiền Hà Nội, ngày 5/10/2021 Nhóm trưởng Lê Thị Giang TIEU LUAN MOI download : skknchat123@gmail.com NHIỆM VỤ CỦA NHĨM NHIỆM VỤ 1: Tính đạo hàm riêng cấp & hàm số 7.2 (3, 12) NHIỆM VỤ 2: Tính tích phân 8.1 với cận đến 12 NHIỆM VỤ 3: Vẽ đồ thị nghiệm riêng PTVP 9.4 với điều kiện ban đầu y(3) = miền [3, 12] NHIỆM VỤ 4: Vẽ đồ thị nghiệm riêng PTVP 9.7 với điều kiện y(3) = 2, y’(3) = miền [3, 12] NHIỆM VỤ 5: Vẽ đồ thị nghiệm riêng PTSP 10.4 kiện ban đầu x(0) = miền [0, 9] NHIỆM VỤ 6: Vẽ đồ thị nghiệm riêng PTSP 10.7 kiện: x(0) = 3, x(1) = miền [0, 9] TIEU LUAN MOI download : skknchat123@gmail.com GIẢI TOÁN NHIỆM VỤ 1: Tính đạo hàm riêng cấp & hàm số 7.2 (3, 12) z = x x import numpy as np from sympy import * x, y = symbols ('x y', real=True) z= (x**3 + y**3) / (x**2 + y**2) z_x = diff (z, x) z_x = lambdify ((x, y), z_x) print("z ' x =",z_x(3,12)) import numpy as np from sympy import * x, y = symbols ('x y', real=True) z= (x**3 + y**3) / (x**2 + y**2) z_y = diff (z, y) z_y = lambdify ((x, y), z_y) print("z ' y =",z_y(3,12)) import numpy as np from sympy import * x, y = symbols ('x y', real=True) z = (x**3 + y**3) / (x**2 + y**2) z_x = diff(z, x) z_xx = (diff(z_x,x)) z_xx = lambdify((x, y), z_xx) print("z ' xx =", z_xx(3,12)) import numpy as np TIEU LUAN MOI download : skknchat123@gmail.com +y −y from sympy import * x, y = symbols('x y', real=True) z = (x**3 + y**3) / (x**2 + y**2) z_x = diff(z, x) z_xy = (diff(z_x,y)) z_xy = lambdify((x, y), z_xy) print("z ' xy =", z_xy(3,12)) import numpy as np from sympy import * x, y = symbols('x y', real=True) z = (x**3 + y**3) / (x**2 + y**2) z_y = diff(z, y) z_yy = (diff(z_y,y)) z_yy = lambdify((x, y), z_yy) print("z ' yy =", z_yy(3,12)) z = import numpy as np from sympy import * x, y = symbols ('x y', real=True) z = log(x+sqrt(x**2 + y**2)) z_x = diff (z, x) z_x = lambdify ((x, y), z_x) print("z ' x =",z_x(3,12)) import numpy as np from sympy import * x, y = symbols ('x y', real=True) z = log(x+sqrt(x**2 + y**2)) z_y = diff (z, y) TIEU LUAN MOI download : skknchat123@gmail.com z_y = lambdify ((x, y), z_y) print("z ' y =",z_y(3,12)) import numpy as np from sympy import * x, y = symbols ('x y', real=True) z = log(x+sqrt(x**2 + y**2)) z_x = diff(z, x) z_xx = (diff(z_x,x)) z_xx = lambdify((x, y), z_xx) print(z_xx(3,12)) import numpy as np from sympy import * x, y = symbols('x y', real=True) z = log(x+sqrt(x**2 + y**2)) z_x = diff(z, x) z_xy = (diff(z_x,y)) z_xy = lambdify((x, y), z_xy) print("z ' xy =", z_xy(3,12)) import numpy as np from sympy import * x, y = symbols('x y', real=True) z = log(x+sqrt(x**2 + y**2)) z_y = diff(z, y) z_yy = (diff(z_y,y)) z_yy = lambdify((x, y), z_yy) print("z ' yy =", z_yy(3,12)) z= acrtan y x Thực hiện: import numpy as np from sympy import * TIEU LUAN MOI download : skknchat123@gmail.com x, y = symbols ('x y', real=True) z = exp(atan(y/x)) z_x = diff (z, x) z_x = lambdify ((x, y), z_x) print("z ' x =",z_x(3,12)) import numpy as np z ' y = 0.0738286826523405 from sympy import * x, y = symbols ('x y', real=True) z = exp(atan(y/x)) z_y = diff (z, y) z_y = lambdify ((x, y), z_y) print("z ' y =",z_y(3,12)) import numpy as np z ' xx = 0.034742909483454376 from sympy import * x, y = symbols ('x y', real=True) z = exp(atan(y/x)) z_x = diff(z, x) z_xx = (diff(z_x,x)) z_xx = lambdify((x, y), z_xx) print("z ' xx =", z_xx(3,12)) import numpy as np z ' xy = 0.01592383351324991 from sympy import * x, y = symbols('x y', real=True) z = exp(atan(y/x)) z_x = diff(z, x) z_xy = (diff(z_x,y)) z_xy = lambdify((x, y), z_xy) print("z ' xy =", z_xy(3,12)) import numpy as np z ' yy = -0.010133348599340853 TIEU LUAN MOI download : skknchat123@gmail.co m from sympy import * x, y = symbols('x y', real=True) z = exp(atan(y/x)) z_y = diff(z, y) z_yy = (diff(z_y,y)) z_yy = lambdify((x, y), z_yy) print("z ' yy =", z_yy(3,12)) z = ln √ √x + y2 +x import numpy as np from sympy import * x, y = symbols ('x y', real=True) z = log (((sqrt(x**2 + y**2))-x) / ((sqrt(x**2 + y**2))+x)) z_x = diff (z, x) z_x = lambdify ((x, y), z_x) print("z ' x =",z_x(3,12)) import numpy as np from sympy import * x, y = symbols ('x y', real=True) z = log (((sqrt(x**2 + y**2))-x) / ((sqrt(x**2 + y**2))+x)) z_y = diff (z, y) z_y = lambdify ((x, y), z_y) print("z ' y =",z_y(3,12)) import numpy as np from sympy import * x, y = symbols ('x y', real=True) TIEU LUAN MOI download : skknchat123@gmail.com z = log (((sqrt(x**2 + y**2))-x) / ((sqrt(x**2 + y**2))+x)) z_x = diff(z, x) z_xx = (diff(z_x,x)) z_xx = lambdify((x, y), z_xx) print("z ' xx =", z_xx(3,12)) import numpy as np z ' xy = 0.012681601309089316 from sympy import * x, y = symbols('x y', real=True) z = log (((sqrt(x**2 + y**2))-x) / ((sqrt(x**2 + y**2))+x)) z_x = diff(z, x) z_xy = (diff(z_x,y)) z_xy = lambdify((x, y), z_xy) print("z ' xy =", z_xy(3,12)) import numpy as np z ' yy = -0.006538950674999176 from sympy import * x, y = symbols('x y', real=True) z = log (((sqrt(x**2 + y**2))-x) / ((sqrt(x**2 + y**2))+x)) z_y = diff(z, y) z_yy = (diff(z_y,y)) z_yy = lambdify((x, y), z_yy) print("z ' yy =", z_yy(3,12)) z = x y Đáp án: Thực hiện: import numpy as np from sympy import * OverflowError: integer division result too large for a float x, y = symbols ('x y', real=True) √1−x + y=arcsin x TIEU LUAN MOI download : skknchat123@gmail.com y' import math import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt def model(y,x): dydx = (math.asin(x) - y)/math.sqrt(1 - x**2) return dydx y3 = x = np.linspace(3,12) y = odeint(model,y3,x) plt.plot(x,y) plt.xlabel('Truc x') plt.ylabel('Truc y') plt.show() ValueError: math domain error - lỗi tập xác định arcsin(x) x € [-1;1] 21 TIEU LUAN MOI download : skknchat123@gmail.com import math import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt def model(y,x): dydx = x*math.log(x) + y/(x*math.log(x)) return dydx y3 = x = np.linspace(3,12) y = odeint(model,y3,x) plt.plot(x,y) plt.xlabel('Truc x') plt.ylabel('Truc y') plt.show() TIEU LUAN MOI download : skknchat123@gmail.com 22 TIEU LUAN MOI download : skknchat123@gmail.com NHIỆM VỤ 4: Vẽ đồ thị nghiệm riêng PTVP 9.7 với điều kiện y(3) = 2, y’(3) = miền [3, 12] y '' −2 y' − y =0 import math import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt def model(U, x): return [U[1], 2*U[1] + U[0]] U0 = [2, 1] xs = np.linspace(3, 12) Us = odeint(model, U0, xs) ys = Us[:,0] plt.xlabel("Truc x") plt.ylabel("Truc y") plt.title("PTVP") plt.plot(xs,ys) plt.show() TIEU LUAN MOI download : skknchat123@gmail.com 23 y '' −9 y ' =e3 x cos x import math import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt TIEU LUAN MOI download : skknchat123@gmail.com def model(U, x): return [U[1], 9*U[0] + math.exp(3*x)*math.cos(x)] U0 = [2, 1] xs = np.linspace(3, 12) Us = odeint(model, U0, xs) ys = Us[:,0] plt.xlabel("Truc x") plt.ylabel("Truc y") plt.title("PTVP") plt.plot(xs,ys) plt.show() y' ' −20 y' +25 y=0 import math 24 TIEU LUAN MOI download : skknchat123@gmail.com import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt def model(U, x): return [U[1], (20*U[1] - 25*U[0])/4] U0 = [2, 1] xs = np.linspace(3, 12) Us = odeint(model, U0, xs) ys = Us[:,0] plt.xlabel("Truc x") plt.ylabel("Truc y") plt.title("PTVP") plt.plot(xs,ys) TIEU LUAN MOI download : skknchat123@gmail.com plt.show() y '' −4 y' =−12 x2−6 x−4 import math import numpy as np from scipy.integrate import odeint 25 TIEU LUAN MOI download : skknchat123@gmail.com import matplotlib.pyplot as plt def model(U, x): return [U[1], 4*U[1] - 12*x**2 - 6*x - 4] U0 = [2, 1] xs = np.linspace(3, 12) Us = odeint(model, U0, xs) ys = Us[:,0] plt.xlabel("Truc x") plt.ylabel("Truc y") plt.title("PTVP") plt.plot(xs,ys) plt.show() TIEU LUAN MOI download : skknchat123@gmail.com y '' − y ' −3 y =e4 x import math import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt 26 TIEU LUAN MOI defmodel(U, download x): : skknchat123@gmail.com return [U[1], 2*U[1] + 3*U[0] + math.exp(4*x)] U0 = [2, 1] xs = np.linspace(3, 12) Us = odeint(model, U0, xs) ys = Us[:,0] plt.xlabel("Truc x") plt.ylabel("Truc y") plt.title("PTVP") plt.plot(xs,ys) plt.show() y '' −5 y ' +4 y =4 x2 ex import math import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt def model(U, x): return [U[1], 5*U[1] - 4*U[0] + (4*x**2)*math.exp(x)] 27 TIEU LUAN MOI download : skknchat123@gmail.com U0 = [2, 1] xs = np.linspace(3, 12) Us = odeint(model, U0, xs) ys = Us[:,0] plt.xlabel("Truc x") plt.ylabel("Truc y") plt.title("PTVP") plt.plot(xs,ys) plt.show() TIEU LUAN MOI download : skknchat123@gmail.com y' ' − y =2 sin x−4 cos x import math import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt def model(U, x): return [U[1], U[0] + 2*math.sin(x) 4*math.cos(x)] U0 = [2, 1] xs = np.linspace(3, 12) 28 TIEU LUAN MOI download : skknchat123@gmail.com Us = odeint(model, U0, xs) ys = Us[:,0] plt.xlabel("Truc x") plt.ylabel("Truc y") plt.title("PTVP") plt.plot(xs,ys) plt.show() y '' −4 y ' =ex [(−4 x +4 ) cos x−(2 x +6 )sin x ] TIEU LUAN MOI download : skknchat123@gmail.com import math ... ngày 5/10/2021 Nhóm trưởng Lê Thị Giang TIEU LUAN MOI download : skknchat123@gmail.com NHIỆM VỤ CỦA NHĨM NHIỆM VỤ 1: Tính đạo hàm riêng cấp & hàm số 7.2 (3, 12) NHIỆM VỤ 2: Tính tích... NHIỆM VỤ 2: Tính tích phân 8.1 với cận đến 12 NHIỆM VỤ 3: Vẽ đồ thị nghiệm riêng PTVP 9.4 với điều kiện ban đầu y(3) = miền [3, 12] NHIỆM VỤ 4: Vẽ đồ thị nghiệm riêng PTVP 9.7 với điều... với điều kiện y(3) = 2, y’(3) = miền [3, 12] NHIỆM VỤ 5: Vẽ đồ thị nghiệm riêng PTSP 10.4 kiện ban đầu x(0) = miền [0, 9] NHIỆM VỤ 6: Vẽ đồ thị nghiệm riêng PTSP 10.7 kiện: x(0)