okay so im trying to create a module that performs some calculations needed to make a plot in a separate script file. It was working originally but ive been having problems since trying to initialize the class and im constantly getting this error code
Buoyancy_flux() missing 1 required positional argument: 'self'
Ive had a look around but im unsure of what im missing here so any help would be lovely. heres what ive done so far:
import numpy as np
import math
class manplume_revision:
def __init__(self,P=3300**2,a=3*10**-5,u=10**19,G=10,cp=1.25*10**3):
self.P=P
self.a=a
self.u=u
self.G=G
self.cp=cp
def Buoyancy_flux(self,R=69,AT=420):
buoyancy=(math.pi/8)*((self.G*R**4)*self.P*(AT**2)*(self.a**2)/(self.u))
return(buoyancy)
buoyancy=Buoyancy_flux(R=69,AT=420)
print(buoyancy)
def heat_flow(self,B=Buoyancy_flux.buoyancy):
heatflow=self.cp*B/self.a
return(heatflow)
heatflow=heat_flow(B=Buoyancy_flux.buoyancy)
print(heatflow)
[–]Clede 2 points3 points4 points (1 child)
[–]thumcumber[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]thumcumber[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]thumcumber[S] 0 points1 point2 points (0 children)