pyoculus 0.1.1
Loading...
Searching...
No Matches
pyoculus.solvers.fixed_point.FixedPoint Class Reference

Class that used to setup the fixed point finder. More...

Inheritance diagram for pyoculus.solvers.fixed_point.FixedPoint:
pyoculus.solvers.base_solver.BaseSolver

Public Member Functions

 __init__ (self, problem, params=dict(), integrator=None, integrator_params=dict())
 Set up the class of the fixed point finder.
 
 compute (self, guess, pp, qq, sbegin=-1.0, send=1.0, tol=None)
 Looks for the fixed point with rotation number pp/qq.
 
 plot (self, plottype=None, xlabel=None, ylabel=None, xlim=None, ylim=None, **kwargs)
 Generates the plot for fixed points.
 
- Public Member Functions inherited from pyoculus.solvers.base_solver.BaseSolver
 is_successful (self)
 Returns True if the computation is successfully completed.
 

Public Attributes

bool is_theta_fixed = False
 
bool is_Z_fixed = False
 
 Nfp = problem.Nfp
 
 niter = params["niter"]
 
 nrestart = params["nrestart"]
 
 pp = pp
 
 qq = qq
 
int dzeta = 2 * np.pi / self.Nfp
 
 s = np.zeros([qq + 1], dtype=np.float64)
 
 theta = np.zeros([qq + 1], dtype=np.float64)
 
 zeta = np.zeros([qq + 1], dtype=np.float64)
 
 x = np.zeros([qq + 1], dtype=np.float64)
 
 y = np.zeros([qq + 1], dtype=np.float64)
 
 z = np.zeros([qq + 1], dtype=np.float64)
 
list history = []
 
 GreenesResidue = rdata.GreenesResidue
 
 MeanResidue = rdata.MeanResidue
 
bool successful = True
 
- Public Attributes inherited from pyoculus.solvers.base_solver.BaseSolver
bool successful = False
 flagging if the computation is done and successful
 

Protected Member Functions

 _newton_method_1 (self, pp, qq, s_guess, sbegin, send, theta, zeta, dzeta, niter, tol)
 
 _newton_method_2 (self, pp, qq, s_guess, sbegin, send, theta_guess, zeta, dzeta, niter, tol)
 
 _newton_method_3 (self, pp, qq, R_guess, Rbegin, Rend, Z, zeta, dzeta, niter, tol)
 

Protected Attributes

bool _is_cylindrical_problem = False
 
- Protected Attributes inherited from pyoculus.solvers.base_solver.BaseSolver
 _integrator_type = RKIntegrator
 
 _params = dict(params)
 
 _integrator = self._integrator_type(integrator_params)
 
 _problem = problem
 
 _integrator_params = dict(integrator_params)
 

Detailed Description

Class that used to setup the fixed point finder.

Constructor & Destructor Documentation

◆ __init__()

pyoculus.solvers.fixed_point.FixedPoint.__init__ ( self,
problem,
params = dict(),
integrator = None,
integrator_params = dict() )

Set up the class of the fixed point finder.

Parameters
problemmust inherit pyoculus.problems.BaseProblem, the problem to solve
paramsdict, the parameters for the solver
integratorthe integrator to use, must inherit \pyoculus.integrators.BaseIntegrator, if set to None by default using RKIntegrator
integrator_paramsdict, the parmaters passed to the integrator

params['niter']=100 – the maximum number of Newton iterations

params['theta']=None – if we look for fixed point on some symmetry line =None : theta is also a free variable to look for =somenumber : only look for theta with this number

params['zeta']=0.0 – the toroidal plane we are after

params['nrestart']=1 – if search failed, the number of time to restart (randomly within the domain)

Reimplemented from pyoculus.solvers.base_solver.BaseSolver.

Member Function Documentation

◆ _newton_method_1()

pyoculus.solvers.fixed_point.FixedPoint._newton_method_1 ( self,
pp,
qq,
s_guess,
sbegin,
send,
theta,
zeta,
dzeta,
niter,
tol )
protected
driver to run Newton's method for one variable s
pp,qq -- integers, the numerator and denominator of the rotation number
s_guess -- the guess of s
sbegin -- the allowed minimum s
send -- the allowed maximum s
theta -- the theta value (fixed)
zeta -- the toroidal plain to investigate
dzeta -- period in zeta
niter -- the maximum number of iterations
tol -- the tolerance of finding a fixed point

◆ _newton_method_2()

pyoculus.solvers.fixed_point.FixedPoint._newton_method_2 ( self,
pp,
qq,
s_guess,
sbegin,
send,
theta_guess,
zeta,
dzeta,
niter,
tol )
protected
driver to run Newton's method for two variable (s,theta)
pp,qq -- integers, the numerator and denominator of the rotation number
s_guess -- the guess of s
sbegin -- the allowed minimum s
send -- the allowed maximum s
theta_guess -- the guess of theta
zeta -- the toroidal plain to investigate
dzeta -- period in zeta
niter -- the maximum number of iterations
tol -- the tolerance of finding a fixed point

◆ _newton_method_3()

pyoculus.solvers.fixed_point.FixedPoint._newton_method_3 ( self,
pp,
qq,
R_guess,
Rbegin,
Rend,
Z,
zeta,
dzeta,
niter,
tol )
protected
driver to run Newton's method for one variable R, for cylindrical problem
pp,qq -- integers, the numerator and denominator of the rotation number
R_guess -- the guess of R
Rbegin -- the allowed minimum R
Rend -- the allowed maximum R
Z -- the Z value (fixed)
zeta -- the toroidal plain to investigate
dzeta -- period in zeta
niter -- the maximum number of iterations
tol -- the tolerance of finding a fixed point

◆ compute()

pyoculus.solvers.fixed_point.FixedPoint.compute ( self,
guess,
pp,
qq,
sbegin = -1.0,
send = 1.0,
tol = None )

Looks for the fixed point with rotation number pp/qq.

Parameters
guessthe initial guess, [s, theta], if ‘params['theta’] == None,[s], ifparams['theta'] ==‘ somevalue
ppinteger, the numerator of the rotation number
qqinteger, the denominator of the rotation number
sbegin=-1.0the allowed minimum s or R
send=1.0the allowed maximum s or R
tol=self._integrator_params['rtol’]*qq– the tolerance of the fixed point
Returns
rdata a class that contains the results that contains rdata.x,rdata.y,rdata,z – the fixed points in xyz coordinates

rdata.s,rdata,theta,rdata,zeta – the fixed points in s,theta,zeta coordinates

rdata.jacobian – the Jacobian of the fixed point constructed by following the tangent map

rdata.GreenesResidue – the Greene's Residue of the fixed point

rdata.MeanResidue – the 'Average Residue' f as defined by Greene

◆ plot()

pyoculus.solvers.fixed_point.FixedPoint.plot ( self,
plottype = None,
xlabel = None,
ylabel = None,
xlim = None,
ylim = None,
** kwargs )

Generates the plot for fixed points.

Parameters
plottypewhich variables to plot: 'RZ' or 'yx', by default using "poincare_plot_type" in problem
xlabel,ylabelwhat to put for the xlabel and ylabel, by default using "poincare_plot_xlabel" in problem
xlim,ylimthe range of plotting, by default plotting the range of all data
**kwargspassed to the plotting routine "plot"

Member Data Documentation

◆ _is_cylindrical_problem

bool pyoculus.solvers.fixed_point.FixedPoint._is_cylindrical_problem = False
protected

◆ dzeta

int pyoculus.solvers.fixed_point.FixedPoint.dzeta = 2 * np.pi / self.Nfp

◆ GreenesResidue

pyoculus.solvers.fixed_point.FixedPoint.GreenesResidue = rdata.GreenesResidue

◆ history

list pyoculus.solvers.fixed_point.FixedPoint.history = []

◆ is_theta_fixed

pyoculus.solvers.fixed_point.FixedPoint.is_theta_fixed = False

◆ is_Z_fixed

bool pyoculus.solvers.fixed_point.FixedPoint.is_Z_fixed = False

◆ MeanResidue

pyoculus.solvers.fixed_point.FixedPoint.MeanResidue = rdata.MeanResidue

◆ Nfp

pyoculus.solvers.fixed_point.FixedPoint.Nfp = problem.Nfp

◆ niter

pyoculus.solvers.fixed_point.FixedPoint.niter = params["niter"]

◆ nrestart

pyoculus.solvers.fixed_point.FixedPoint.nrestart = params["nrestart"]

◆ pp

pyoculus.solvers.fixed_point.FixedPoint.pp = pp

◆ qq

pyoculus.solvers.fixed_point.FixedPoint.qq = qq

◆ s

pyoculus.solvers.fixed_point.FixedPoint.s = np.zeros([qq + 1], dtype=np.float64)

◆ successful

bool pyoculus.solvers.fixed_point.FixedPoint.successful = True

◆ theta

pyoculus.solvers.fixed_point.FixedPoint.theta = np.zeros([qq + 1], dtype=np.float64)

◆ x

pyoculus.solvers.fixed_point.FixedPoint.x = np.zeros([qq + 1], dtype=np.float64)

◆ y

pyoculus.solvers.fixed_point.FixedPoint.y = np.zeros([qq + 1], dtype=np.float64)

◆ z

pyoculus.solvers.fixed_point.FixedPoint.z = np.zeros([qq + 1], dtype=np.float64)

◆ zeta

pyoculus.solvers.fixed_point.FixedPoint.zeta = np.zeros([qq + 1], dtype=np.float64)

The documentation for this class was generated from the following file: