May-27-2020, 09:52 PM
(This post was last modified: May-27-2020, 10:06 PM by Ae_Lovecraft.)
I'm triying to make a double reimann sum, with a limit b = (x^2 + y^2 = 16), the problem is when I use Sympy and marks as a TypeError in the linespace column, I tried to def the ecuation but nothing works, I'm doing somethin wrong or should I change something?
import numpy as np
import matplotlib.pyplot as plt
import sympy
# function to integrate = x +3*y + 1
# Limit funtion 'b' =(x^2 + y^2 = 16)
Width=15; Length=20;
x = sympy.Symbol('x')
a = 0
b =(sympy.sqrt(16-x**2))
c = 0
d = 3
#Heigth of x
deltax= (b - a) / Width
#Heigth of y
deltay = (d - c) / Length
#Area of each square
dA = deltax * deltay
x = np.linspace((a, b - deltax, Ancho));
y = np.linspace((c, d - deltay, Largo));
f = lambda x,y: x +3*y + 1
[X, Y] = np.meshgrid(x, y);
#reimann sum
Suma=sum(dA * f(X, Y))
Suma = sum(Suma)
int(Suma)
print(Suma)Error: File "<__array_function__ internals>", line 4, in linspace
TypeError: _linspace_dispatcher() missing 1 required positional argument: 'stop'
