pymead.core.ferguson.Ferguson#
- class Ferguson(point_sequence: PointSequence, default_nt: int | None = None, name: str | None = None, t_start: float | None = None, t_end: float | None = None, **kwargs)[source]#
Bases:
ParametricCurve- __init__(point_sequence: PointSequence, default_nt: int | None = None, name: str | None = None, t_start: float | None = None, t_end: float | None = None, **kwargs)[source]#
Computes the Ferguson curve (see “Multivariable Curve Interpolation” by James Ferguson) through the 4 control points
P.- Parameters:
point_sequence (PointSequence) – Sequence of points defining the control points for the Ferguson curve. Points 0 and 3 define the starting and ending points for the curve, respectively. Point 1 defines the head of the tangent vector at Point 0 (Point 0 is the tail). Point 2 defines the tail of the tangent vector at Point 3 (point 2 is the head).
name (str or
None) – Optional name for the curve. Default:Nonet_start (float or
None) – Optional starting parameter vector value for the Bézier curve. Not specifying this value automatically gives a value of0.0. Default:Nonet_end (float or
None) – Optional ending parameter vector value for the Bézier curve. Not specifying this value automatically gives a value of1.0. Default:None
Methods
derivative(t, order)Calculates an arbitrary-order derivative of the Ferguson curve
evaluate([t])Evaluates the curve using an optionally specified parameter vector.
evaluate_xy([t])get_control_point_array()Gets a dictionary representation of the pymead object.
plot([ax, nt, show, save_file])Plots the airfoil to a
matplotlibfigure.point_removal_deletes_curve()point_sequence()points()remove()remove_point([idx, point])reverse_point_sequence()set_point_sequence(point_sequence)Attributes
- derivative(t: ndarray, order: int) ndarray[source]#
Calculates an arbitrary-order derivative of the Ferguson curve
- Parameters:
t (np.ndarray) – The parameter vector
order (int) – The derivative order. For example,
order=2returns the second derivative.
- Returns:
An array of
shape=(N,2)whereNis the number of evaluated points specified by the \(t\) vector. The columns represent \(C^{(m)}_x(t)\) and \(C^{(m)}_y(t)\), where \(m\) is the derivative order.- Return type:
np.ndarray
- evaluate(t: array | None = None, **kwargs)[source]#
Evaluates the curve using an optionally specified parameter vector.
- Parameters:
t (np.ndarray or
None) – Optional direct specification of the parameter vector for the curve. Not specifying this value gives a linearly spaced parameter vector fromt_startort_endwith the default size. Default:None- Returns:
Data class specifying the following information about the Bézier curve:
\[C_x(t), C_y(t), C'_x(t), C'_y(t), C''_x(t), C''_y(t), \kappa(t)\]where the \(x\) and \(y\) subscripts represent the \(x\) and \(y\) components of the vector-valued functions \(\vec{C}(t)\), \(\vec{C}'(t)\), and \(\vec{C}''(t)\).
- Return type:
- get_dict_rep()[source]#
Gets a dictionary representation of the pymead object. In general, this dictionary should consist of only the required arguments for object instantiation. For example, the dictionary representation of a point looks something like this:
{"x": 0.3, "y": 0.5}. If the argument requires a reference to aPymeadObjrather than a string or float value, thename()method should be the value that is stored. For an example, see the overridden value of this method inpymead.core.airfoil.Airfoil. All subclasses ofPymeadObjmust implement this method, since it is the way pymead objects are stored in saved instances of aGeometryCollection(.jmeafiles).
- plot(ax: Axes | None = None, nt: int = 100, show: bool = True, save_file: str | None = None, **plt_kwargs)[source]#
Plots the airfoil to a
matplotlibfigure.- Parameters:
ax (plt.Axes or None) – Matplotlib Axes object on which the curve will be plotted. If specified, this method will only. If
None, a new figure will be created. Default:Nonent (int) – Number of parametric values to evaluate along the curve. Default: 100
show (bool) – Whether to immediately show the curve plot. Ignored if
axis notNone. Default:Truesave_file (str or None) – Name of the file to save. If
None, the curve image will not be saved to file. Ignored ifaxis notNone. Default:Noneplt_kwargs – Additional keyword arguments to pass to
matplotlib.pyplot.plot