hascorps.blogg.se

Scipy fsolve
Scipy fsolve













scipy fsolve

Print('Error: gradient could not be found with fsolve when L=inf') Result = fsolve(self.findgrad, start, full_output=1) Start = np.log((self.givenh - self.hs) / abs(x))

scipy fsolve

# find gradient using log transform of grad to avoid negative values Print('Segment: no solution found: '), mesgĭef _init_(self, k, H, c, h, x, rhof, rhos, L, ztop=0, sealevel=0):Īssert x self.hs, "Input error: inland head smaller than equivalent freshwater head at top of aquifer" If debug: print('Segment: valid solution found:') If debug: print('Segment: final solution out of ray parameter range:')

scipy fsolve

If debug: print('Segment: final solution out of surface parameter range:') X, infodict, ier, mesg = fsolve(system, guess, full_output=1) # return solution if exists Guess = (pos - self.base, atan2(pos, pos), tsup) Pos = ray.getPoint(tsup) # a point really far away from current position # ray can intersect at most twice, so create a second guess If debug: print('Segment: first solution out of range. X, infodict, ier, mesg = fsolve(system, guess, full_output=1) # if solution found Guess = (ray.pos - self.base, atan2(ray.pos, ray.pos), 0) # solve with guess at current ray position Z = self.z(params, params) - ray.z(params) Y = self.y(params, params) - ray.y(params) X = self.x(params, params) - ray.x(params) Returns the displacement from a point on the ray to a In parametric form (u,v,t) if such a solution exists. Returns the first intersection of a ray with the surface If distance(secpos_front,pos) < distance(secpos_back,pos): # Check which section point lies "in front" of the ray If self.backsurface(secpos0_back) - (vec/vec*(secpos0_back-pos)+pos) > numerror: If ontsurface(secpos0_front) - (vec/vec*(secpos0_front-pos)+pos) > numerror: Secpos0_back = fsolve(lambda x : self.backsurface(x) - (vec/vec*(x-pos)+pos),pos,pos]) Secpos0_front = fsolve(lambda x : ontsurface(x) - (vec/vec*(x-pos)+pos),pos) # neutrino masses from M_tot_IH and deletes M_tot_IHĭelta_m_squared_atm = -delta_m_squared_atm M1,opt_output,success,output_message = fsolve(m1_func,sum_masses/3.,(sum_masses,delta_m_squared_atm,delta_m_squared_sol),full_output=True) # neutrino masses from M_tot_NH and deletes M_tot_NH # any string containing letter 'n' will be considered as refering to normal hierarchy P1,Q1,A1,P2,Q2,A2,P3,Q3,A3 = fsolve(bifurcation_3,x,args=(PQA1,PQA2,PQA3,\ĭef get_masses(delta_m_squared_atm, delta_m_squared_sol, sum_masses, hierarchy): + np.exp( - (self.data - self.k) / self.k))ĭef _call_(self,n,dt,Vessel1,Vessel2,Vessel3,ID): #self.data = - 12.92790 #delete if rtbis is available Self.data = fsolve(self.steady_vs, -1.e3) #find steady - state V_s Self.data = self.data #transferred to steady_vs via common

scipy fsolve

Self.data = (self.data / self.k) ** self.k #a_I in model #self.data = 14.12579 #delete if rtbis is available Self.data = fsolve(self.steady, 0.) #find steady - state C















Scipy fsolve