I am very new to this, so I have no idea what is going wrong. I'm trying to plot the equation for the magnetic field through the axis of a solenoid in jupyter notebooks. It keeps returning the error 'TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'int''. Here is the code for the equation:
def model(x,a,b,c,l,r):
y=a*b*c*.5*((x/(math.sqrt(x**2+r**2)))-((x-l)/(math.sqrt((x-l)**2+r**2)))
return y
Anything helps.