Class that used to setup the fixed point finder.
More...
|
| | __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.
|
| |
| | __init__ (self, problem, params=dict(), integrator=None, integrator_params=dict()) |
| | Sets up the solver.
|
| |
| | is_successful (self) |
| | Returns True if the computation is successfully completed.
|
| |
|
| 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 = False |
| | flagging if the computation is done and successful
|
| |
|
| | _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) |
| |
Class that used to setup the fixed point finder.
◆ __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
-
| problem | must inherit pyoculus.problems.BaseProblem, the problem to solve |
| params | dict, the parameters for the solver |
| integrator | the integrator to use, must inherit \pyoculus.integrators.BaseIntegrator, if set to None by default using RKIntegrator |
| integrator_params | dict, 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)
◆ _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
-
| guess | the initial guess, [s, theta], if ‘params['theta’] == None,[s], ifparams['theta'] ==‘ somevalue |
| pp | integer, the numerator of the rotation number |
| qq | integer, the denominator of the rotation number |
| sbegin=-1.0 | the allowed minimum s or R |
| send=1.0 | the 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
-
| plottype | which variables to plot: 'RZ' or 'yx', by default using "poincare_plot_type" in problem |
| xlabel,ylabel | what to put for the xlabel and ylabel, by default using "poincare_plot_xlabel" in problem |
| xlim,ylim | the range of plotting, by default plotting the range of all data |
| **kwargs | passed to the plotting routine "plot" |
◆ _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
| bool 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 |
| pyoculus.solvers.fixed_point.FixedPoint.s = np.zeros([qq + 1], dtype=np.float64) |
◆ theta
| pyoculus.solvers.fixed_point.FixedPoint.theta = np.zeros([qq + 1], dtype=np.float64) |
| pyoculus.solvers.fixed_point.FixedPoint.x = np.zeros([qq + 1], dtype=np.float64) |
| pyoculus.solvers.fixed_point.FixedPoint.y = np.zeros([qq + 1], dtype=np.float64) |
| 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: