Application Programming Interface (API)

skijumpdesign/functions.py

skijumpdesign.functions.cartesian_from_measurements(distances, angles, takeoff_distance=None)[source]

Returns the Cartesian coordinates of a surface given measurements of distance along the surface and angle measurements at each distance measure along with the takeoff point and takeoff angle.

Parameters:
  • distances (array_like, shape(n,)) – Distances measured from an origin location on a jump surface along the surface of the jump.
  • angles (array_like, shape(n,)) – Angle of the slope surface at the distance measures in radians. Positive about a right handed z axis.
  • takeoff_distance (float) – Distance value where the takeoff is located (only if the takeoff is on the surface on the measured portion of the surface).
Returns:

  • x (ndarray, shape(n-1,)) – Longitudinal coordinates of the surface.
  • y (ndarray, shape(n-1,)) – Vertical coordinates of the surface.
  • takeoff_point (tuple of floats) – (x, y) coordinates of the takeoff point.
  • takeoff_angle (float) – Angle in radians at the takeoff point.

skijumpdesign.functions.make_jump(slope_angle, start_pos, approach_len, takeoff_angle, fall_height, plot=False)[source]

Returns a set of surfaces and output values that define the equivalent fall height jump design and the skier’s flight trajectory.

Parameters:
  • slope_angle (float) – The parent slope angle in degrees. Counter clockwise is positive and clockwise is negative.
  • start_pos (float) – The distance in meters along the parent slope from the top (x=0, y=0) to where the skier starts skiing.
  • approach_len (float) – The distance in meters along the parent slope the skier travels before entering the takeoff.
  • takeoff_angle (float) – The angle in degrees at end of the takeoff ramp. Counter clockwise is positive and clockwise is negative.
  • fall_height (float) – The desired equivalent fall height of the landing surface in meters.
  • plot (boolean) – If True a matplotlib figure showing the jump will appear.
Returns:

  • slope (FlatSurface) – The parent slope starting at (x=0, y=0) until a meter after the jump.
  • approach (FlatSurface) – The slope the skier travels on before entering the takeoff.
  • takeoff (TakeoffSurface) – The circle-clothoid-circle-flat takeoff ramp.
  • landing (LandingSurface) – The equivalent fall height landing surface.
  • landing_trans (LandingTransitionSurface) – The minimum exponential landing transition.
  • flight (Trajectory) – The maximum velocity flight trajectory.
  • outputs (dictionary) – A dictionary of output values with keys: Takeoff Speed, Flight Time, and Snow Budget.

skijumpdesign.functions.plot_efh(surface, takeoff_angle, takeoff_point, show_knee_collapse_line=True, skier=None, increment=0.2, ax=None)[source]

Returns a matplotlib axes containing a plot of the surface and its corresponding equivalent fall height.

Parameters:
  • surface (Surface) – A Surface for a 2D curve expressed in a standard Cartesian coordinate system.
  • takeoff_angle (float) – Takeoff angle in degrees.
  • takeoff_point (2-tuple of floats) – x and y coordinates relative to the surface’s coordinate system of the point at which the skier leaves the takeoff ramp.
  • show_knee_collapse_line (bool, optional) – Displays a line on the EFH plot indicating the EHF above which even elite ski jumpers are unable to prevent knee collapse. This value is taken from [Minetti].
  • skier (Skier, optional) – A skier instance. This is passed to calculate_efh.
  • increment (float, optional) – x increment in meters between each calculated landing location. This is passed to calculate_efh.
  • ax (array of Axes, shape(2,), optional) – An existing matplotlib axes to plot to - ax[0] equivalent fall height, ax[1] surface profile.

References

[Minetti]Minetti AE, Ardigo LP, Susta D, Cotelli F (2010) Using leg muscles as shock absorbers: theoretical predictions and experimental results of drop landing performance. Ergonomics 41(12):1771–1791
skijumpdesign.functions.plot_jump(slope, approach, takeoff, landing, landing_trans, flight)[source]

Returns a matplotlib axes with the jump and flight plotted given the surfaces created by make_jump().

skijumpdesign.functions.snow_budget(parent_slope, takeoff, landing, landing_trans)[source]

Returns the jump’s cross sectional snow budget area of the EFH jump.

Parameters:
Returns:

The cross sectional snow budget (area between the parent slope and jump curve) in meters squared.

Return type:

float

skijumpdesign/skiers.py

class skijumpdesign.skiers.Skier(mass=75.0, area=0.34, drag_coeff=0.821, friction_coeff=0.03, tolerable_sliding_acc=1.5, tolerable_landing_acc=3.0)[source]

Bases: object

Class that represents a two dimensional skier who can slide on surfaces and fly in the air.

Instantiates a skier with default properties.

Parameters:
  • mass (float, optional) – The mass of the skier in kilograms.
  • area (float, optional) – The frontal area of the skier in squared meters.
  • drag_coeff (float, optional) – The air drag coefficient of the skier.
  • friction_coeff (float, optional) – The sliding friction coefficient between the skis and the slope.
  • tolerable_sliding_acc (float, optional) – The maximum normal acceleration in G’s that a skier can withstand while sliding.
  • tolerable_landing_acc (float, optional) – The maximum normal acceleration in G’s that a skier can withstand when landing.
drag_force(speed)[source]

Returns the drag force in Newtons opposing the speed in meters per second of the skier.

end_speed_on(surface, **kwargs)[source]

Returns the ending speed after sliding on the provided surface. Keyword args are passed to Skier.slide_on().

end_vel_on(surface, **kwargs)[source]

Returns the ending velocity (vx, vy) after sliding on the provided surface. Keyword args are passed to Skier.slide_on().

fly_to(surface, init_pos, init_vel, fine=True, compute_acc=True, logging_type='info')[source]

Returns the flight trajectory of the skier given the initial conditions and a surface which the skier contacts at the end of the flight trajectory.

Parameters:
  • surface (Surface) – A landing surface. This surface must intersect the flight path.
  • init_pos (2-tuple of floats) – The x and y coordinates of the starting point of the flight in meters.
  • init_vel (2-tuple of floats) – The x and y components of the skier’s velocity at the start of the flight in meters per second.
  • fine (boolean) – If True two integrations occur. The first finds the landing time with coarse time steps and the second integrates over a finer equally spaced time steps. False will skip the second integration.
  • compute_acc (boolean, optional) – If true acceleration will be calculated. If false acceleration is set to zero.
  • logging_type (string) – The logging level desired for the non-debug logging calls in this function. Useful for suppressing too much information since this runs a lot.
Returns:

trajectory – A trajectory instance that contains the time, position, velocity, acceleration, speed, and slope of the flight.

Return type:

Trajectory

Raises:

InvalidJumpError – Error if the skier does not contact a surface within Skier.max_flight_time.

friction_force(speed, slope=0.0, curvature=0.0)[source]

Returns the friction force in Newtons opposing the speed of the skier.

Parameters:
  • speed (float) – The tangential speed of the skier in meters per second.
  • slope (float, optional) – The slope of the surface at the skier’s point of contact.
  • curvature (float, optional) – The curvature of the surface at the skier’s point of contact.
max_flight_time = 30.0
samples_per_sec = 360
slide_on(surface, init_speed=0.0, fine=True)[source]

Returns the trajectory of the skier sliding over a surface.

Parameters:
  • surface (Surface) – A surface that the skier will slide on.
  • init_speed (float, optional) – The magnitude of the velocity of the skier at the start of the surface which is directed tangent to the surface.
  • fine (boolean) – If True two integrations occur. The first finds the exit time with coarse time steps and the second integrates over a finer equally spaced time steps. False will skip the second integration.
Returns:

trajectory – A trajectory instance that contains the time, position, velocity, acceleration, speed, and slope of the slide,

Return type:

Trajectory

Raises:

InvalidJumpError – Error if skier can’t reach the end of the surface within 1000 seconds.

speed_to_land_at(landing_point, takeoff_point, takeoff_angle, surf)[source]

Returns the magnitude of the velocity required to land at a specific point given launch position and angle.

Parameters:
  • landing_point (2-tuple of floats) – The (x, y) coordinates of the desired landing point in meters.
  • takeoff_point (2-tuple of floats) – The (x, y) coordinates of the takeoff point in meters.
  • takeoff_angle (float) – The takeoff angle in radians.
  • surf (Surface) – This should most likely be the parent slope but needs to be something that ensures the skier flies past the landing point.
Returns:

takeoff_speed – The magnitude of the takeoff velocity.

Return type:

float

skijumpdesign/surfaces.py

class skijumpdesign.surfaces.ClothoidCircleSurface(entry_angle, exit_angle, entry_speed, tolerable_acc, init_pos=(0.0, 0.0), gamma=0.99, num_points=200)[source]

Bases: skijumpdesign.surfaces.Surface

Class that represents a surface made up of a circle bounded by two clothoids.

Instantiates a clothoid-circle-clothoid curve.

Parameters:
  • entry_angle (float) – The entry angle tangent to the start of the left clothoid in radians.
  • exit_angle (float) – The exit angle tangent to the end of the right clothoid in radians.
  • entry_speed (float) – The magnitude of the skier’s velocity in meters per second as they enter the left clothiod.
  • tolerable_acc (float) – The tolerable normal acceleration of the skier in G’s.
  • init_pos (2-tuple of floats) – The x and y coordinates of the start of the left clothoid.
  • gamma (float) – Fraction of circular section.
  • num_points (integer, optional) – The number of points in each of the three sections of the curve.
class skijumpdesign.surfaces.FlatSurface(angle, length, init_pos=(0.0, 0.0), num_points=100)[source]

Bases: skijumpdesign.surfaces.Surface

Class that represents a flat surface angled relative to the horizontal.

Instantiates a flat surface that is oriented at a counterclockwise angle from the horizontal.

Parameters:
  • angle (float) – The angle of the surface in radians. Counterclockwise (about z) is positive, clockwise is negative.
  • length (float) – The distance in meters along the surface from the initial position.
  • init_pos (2-tuple of floats, optional) – The x and y coordinates in meters that locate the start of the surface.
  • num_points (integer, optional) – The number of points used to define the surface coordinates.
angle

Returns the angle wrt to horizontal in radians of the surface.

distance_from(xp, yp)[source]

Returns the shortest distance from point (xp, yp) to the surface.

Parameters:
  • xp (float) – The horizontal, x, coordinate of the point.
  • yp (float) – The vertical, y, coordinate of the point.
Returns:

distance – The shortest distance from the point to the surface. If the point is above the surface a positive distance is returned, else a negative distance.

Return type:

float

class skijumpdesign.surfaces.HorizontalSurface(height, length, start=0.0, num_points=100)[source]

Bases: skijumpdesign.surfaces.Surface

Instantiates a class that represents a horizontal surface at a height above the x axis.abs

Parameters:
  • height (float) – The height of the surface above the horizontal x axis in meters.
  • length (float) – The length of the surface in meters.
  • start (float, optional) – The x location of the start of the left most point of the surface.
  • num_points (integer, optional) – The number of (x,y) coordinates.
distance_from(xp, yp)[source]

Returns the shortest distance from point (xp, yp) to the surface.

Parameters:
  • xp (float) – The horizontal, x, coordinate of the point.
  • yp (float) – The vertical, y, coordinate of the point.
Returns:

distance – The shortest distance from the point to the surface. If the point is above the surface a positive distance is returned, else a negative distance.

Return type:

float

class skijumpdesign.surfaces.LandingSurface(skier, takeoff_point, takeoff_angle, max_landing_point, fall_height, surf)[source]

Bases: skijumpdesign.surfaces.Surface

Class that defines an equivalent fall height landing surface.

Instantiates a surface that ensures impact velocity is equivalent to that from a vertical fall.

Parameters:
  • skier (Skier) – A skier instance.
  • takeoff_point (2-tuple of floats) – The point at which the skier leaves the takeoff ramp.
  • takeoff_angle (float) – The takeoff angle in radians.
  • max_landing_point (2-tuple of floats) – The maximum x position that the landing surface will attain in meters. In the standard design, this is the start of the landing transition point.
  • fall_height (float) – The desired equivalent fall height in meters. This should always be greater than zero.
  • surf (Surface) – A surface below the full flight trajectory, the parent slope is a good choice. It is useful if the distance_from() method runs very fast, as it is called a lot internally.
allowable_impact_speed

Returns the perpendicular speed one would reach if dropped from the provided fall height.

class skijumpdesign.surfaces.LandingTransitionSurface(parent_surface, flight_traj, fall_height, tolerable_acc, num_points=100)[source]

Bases: skijumpdesign.surfaces.Surface

Class representing a acceleration limited exponential curve that transitions the skier from the landing surface to the parent slope.

Instantiates an exponentially decaying surface that connects the landing surface to the parent slope.

Parameters:
  • parent_surface (FlatSurface) – The parent slope in which the landing transition should be tangent to on exit.
  • flight_traj (Trajectory) – The flight trajectory from the takeoff point to the parent slope.
  • fall_height (float) – The desired equivalent fall height for the jump design in meters.
  • tolerable_acc (float) – The maximum normal acceleration the skier should experience in the landing.
  • num_points (integer) – The number of points in the surface.
acc_error_tolerance = 0.001
allowable_impact_speed

Returns the perpendicular speed one would reach if dropped from the provided fall height.

calc_trans_acc(x)[source]

Returns the acceleration in G’s the skier feels at the exit transition occurring if the transition starts at the provided horizontal location, x.

delta = 0.01
find_parallel_traj_point()[source]

Returns the position of a point on the flight trajectory where its tangent is parallel to the parent slope. This is used as a starting guess for the start of the landing transition point.

find_transition_point()[source]

Returns the horizontal position indicating the intersection of the flight path with the beginning of the landing transition. This is the last possible transition point, that by definition minimizes the transition snow budget, that satisfies the allowable transition acceleration.

Notes

This uses Newton’s method to find an adequate point but may fail to do so with some combinations of flight trajectories, parent slope geometry, and allowable acceleration. A warning will be emitted if the maximum number of iterations is reached in this search and the curve is likely invalid.

max_iterations = 1000
class skijumpdesign.surfaces.Surface(x, y)[source]

Bases: object

Base class for a 2D curve that represents the cross section of a surface expressed in a standard Cartesian coordinate system.

Instantiates an arbitrary 2D surface.

Parameters:
  • x (array_like, shape(n,)) – The horizontal, x, coordinates of the slope. x[0] should be the left most horizontal position and corresponds to the start of the surface. This should be monotonically increasing and ideally have no adjacent spacings less than 0.3 meter.
  • y (array_like, shape(n,)) – The vertical, y, coordinates of the slope. y[0] corresponds to the start of the surface.
Warns:
  • x and y values that have any x spacings larger than 0.3 meters will be
  • resampled at x spacings of approximately 0.3 meters.
area_under(x_start=None, x_end=None, interval=0.05)[source]

Returns the area under the curve integrating wrt to the x axis at 0.05 m intervals using the trapezoidal rule.

calculate_efh(takeoff_angle, takeoff_point, skier, increment=0.2)[source]

Returns the equivalent fall height for the surface at the specified constant intervals relative to the provided takeoff point or the start of the surface.

Parameters:
  • takeoff_angle (float) – Takeoff angle in radians.
  • takeoff_point (2-tuple of floats) – x and y coordinates of the point at which the skier leaves the takeoff ramp.
  • skier (Skier) – A skier instance.
  • increment (float, optional) – x increment in meters between each calculated landing location.
Returns:

  • distance_x (ndarray, shape(n,)) – Horizontal x locations of the equivalent fall height measures spaced at the specified meter intervals relative to leftmost point on the surface or the takeoff point, whichever is greater.
  • efh (ndarray, shape(n,)) – The equivalent fall height corresponding to each value in distance_x.
  • takeoff_speeds (ndarray, shape(n,)) – The takeoff speed required to land the corresponding x coordinate.

distance_from(xp, yp)[source]

Returns the shortest distance from point (xp, yp) to the surface.

Parameters:
  • xp (float) – The horizontal, x, coordinate of the point.
  • yp (float) – The vertical, y, coordinate of the point.
Returns:

distance – The shortest distance from the point to the surface. If the point is above the surface a positive distance is returned, else a negative distance.

Return type:

float

Note

This general implementation can be slow, so implement overloaded distance_from() methods in subclasses when you can.

end

Returns the x and y coordinates at the end point of the surface.

height_above(surface)[source]

Returns an array of values giving the height each point in this surface is above the provided surface.

length()[source]

Returns the length of the surface in meters via a numerical line integral.

max_x_spacing = 0.3
plot(ax=None, **plot_kwargs)[source]

Returns a matplotlib axes containing a plot of the surface.

Parameters:
  • ax (Axes) – An existing matplotlib axes to plot to.
  • plot_kwargs (dict) – Arguments to be passed to Axes.plot().
shift_coordinates(delx, dely)[source]

Shifts the x and y coordinates by delx and dely respectively. This modifies the surface in place.

start

Returns the x and y coordinates at the start point of the surface.

class skijumpdesign.surfaces.TakeoffSurface(skier, entry_angle, exit_angle, entry_speed, time_on_ramp=0.25, gamma=0.99, init_pos=(0.0, 0.0), num_points=200)[source]

Bases: skijumpdesign.surfaces.Surface

Class that represents a surface made up of a circle bounded by two clothoids with a flat exit surface.

Instantiates the takeoff curve with the flat takeoff ramp added to the terminus of the clothoid-circle-clothoid curve.

Parameters:
  • skier (Skier) – A skier instance.
  • entry_angle (float) – The entry angle tangent to the start of the left clothoid in radians.
  • exit_angle (float) – The exit angle tangent to the end of the right clothoid in radians.
  • entry_speed (float) – The magnitude of the skier’s velocity in meters per second as they enter the left clothiod.
  • time_on_ramp (float, optional) – The time in seconds that the skier should be on the takeoff ramp before launch.
  • gamma (float, optional) – Fraction of circular section.
  • init_pos (2-tuple of floats, optional) – The x and y coordinates of the start of the left clothoid.
  • num_points (integer, optional) – The number of points in each of the three sections of the curve.

skijumpdesign/trajectories.py

class skijumpdesign.trajectories.Trajectory(t, pos, vel=None, acc=None, speed=None)[source]

Bases: object

Class that describes a 2D trajectory.

Instantiates a trajectory.

Parameters:
  • t (array_like, shape(n,)) – The time values of the trajectory.
  • pos (array_like, shape(n, 2)) – The x and y coordinates of the position.
  • vel (array_like, shape(n, 2), optional) – The x and y components of velocity. If not provided numerical differentiation of position will be used.
  • acc (array_like, shape(n, 2), optional) – The x and y components of acceleration. If not provided numerical differentiation of velocity will be used.
  • speed (array_like, shape(n, 2), optional) – The magnitude of the velocity. If not provided it will be calculated from the velocity components.
duration

Returns the duration of the trajectory in seconds.

plot(ax=None, **plot_kwargs)[source]

Returns a matplotlib axes containing a plot of the trajectory position.

Parameters:
  • ax (Axes) – An existing matplotlib axes to plot to.
  • plot_kwargs (dict) – Arguments to be passed to Axes.plot().
plot_time_series()[source]

Plots all of the time series stored in the trajectory.

shift_coordinates(delx, dely)[source]

Shifts the x and y coordinates by delx and dely respectively. This modifies the surface in place.

skijumpdesign/utils.py

exception skijumpdesign.utils.InvalidJumpError[source]

Bases: Exception

Custom class to signal that a poor combination of parameters have been supplied to the surface building functions.

skijumpdesign.utils.speed2vel(speed, angle)[source]

Returns the x and y components of velocity given the magnitude and angle of the velocity vector.

Parameters:
  • speed (float) – Magnitude of the velocity vector in meters per second.
  • angle (float) – Angle of velocity vector in radians. Clockwise is negative and counter clockwise is positive.
Returns:

  • vel_x (float) – X component of velocity in meters per second.
  • vel_y (float) – Y component of velocity in meters per second.

skijumpdesign.utils.vel2speed(hor_vel, ver_vel)[source]

Returns the magnitude and angle of the velocity vector given the horizontal and vertical components.

Parameters:
  • hor_vel (float) – X component of velocity in meters per second.
  • ver_vel (float) – Y component of velocity in meters per second.
Returns:

  • speed (float) – Magnitude of the velocity vector in meters per second.
  • angle (float) – Angle of velocity vector in radians. Clockwise is negative and counter clockwise is positive.