Introduction

Most of the functions work on a KPS3 or KPS4 object. For this, the variable s is used. Such a variable can be created with the lines:

using KiteModels, KitePodModels, KiteUtils
const s = KPS3(KCU(se()))

Or, if you want to use the 4 point kite model:

using KiteModels, KitePodModels, KiteUtils
const s = KPS4(KCU(se()))

Functions with an "!" as last character of the function name modify one of more of their parameters, in this context mostly the variable s.

Input functions

KiteModels.set_v_reel_out!Function
set_v_reel_out!(s::AKM, v_reel_out, t_0, period_time = 1.0 / s.set.sample_freq)

Setter for the reel-out speed. Must be called on every timestep (before each simulation). It also updates the tether length, therefore it must be called even if v_reel_out has not changed.

  • t_0 the start time of the next timestep relative to the start of the simulation [s]
KiteModels.set_depower_steering!Function
set_depower_steering!(s::AKM, depower, steering)

Setter for the depower and steering model inputs.

Parameters:

  • depower: Relative depower, must be between 0 .. 1.0
  • steering: Relative steering, must be between -1.0 .. 1.0.

This function sets the variables s.depower, s.steering and s.alpha_depower.

It takes the depower offset c0 and the dependency of the steering sensitivity from the depower settings into account.

KiteModels.set_v_wind_ground!Function
set_v_wind_ground!(s::AKM, height, v_wind_gnd=s.set.v_wind, wind_dir=0.0)

Set the vector of the wind-velocity at the height of the kite. As parameter the height, the ground wind speed [m/s] and the wind direction [radians] are needed. Must be called every at each timestep.

Output functions

KiteModels.pos_kiteFunction
pos_kite(s::KPS4)

Return the position of the kite (top particle).

pos_kite(s::KPS3)

Return the position of the kite (top particle).

KiteModels.calc_heightFunction
calc_height(s::KPS4)

Determine the height of the topmost kite particle above ground.

calc_height(s::KPS3)

Determine the height of the kite particle above ground.

KiteUtils.calc_courseFunction
calc_course(s::AKM)

Determine the course angle of the kite in radian. Undefined if the velocity of the kite is near zero.

KiteModels.winch_forceFunction
winch_force(s::KPS4)

Return the absolute value of the force at the winch as calculated during the last timestep.

winch_force(s::KPS3)

Return the absolute value of the force at the winch as calculated during the last timestep.

KiteModels.spring_forcesFunction
spring_forces(s::AKM)

Return an array of the scalar spring forces of all tether segements.

KiteModels.lift_dragFunction
lift_drag(s::AKM)

Return a tuple of the scalar lift and drag forces.

Example:

lift, drag = lift_drag(s)
KiteModels.v_wind_kiteFunction
v_wind_kite(s::AKM)

Return the vector of the wind speed at the height of the kite.

KiteModels.kite_ref_frameFunction
kite_ref_frame(s::KPS4)

Returns a tuple of the x, y, and z vectors of the kite reference frame.

kite_ref_frame(s::KPS3)

Returns a tuple of the x, y, and z vectors of the kite reference frame.

KiteModels.orient_eulerFunction
orient_euler(s::AKM)

Calculate and return the orientation of the kite in euler angles (roll, pitch, yaw) as SVector.

High level simulation interface

KiteModels.init_sim!Function
init_sim!(s; t_end=1.0, stiffness_factor=0.035, prn=false)

Initialises the integrator of the model.

Parameters:

  • s: an instance of an abstract kite model
  • t_end: end time of the simulation; normally not needed
  • stiffness_factor: factor applied to the tether stiffness during initialisation
  • prn: if set to true, print the detailed solver results

Returns: An instance of a DAE integrator.

KiteModels.next_step!Function
next_step!(s::AKM, integrator; v_ro = 0.0, v_wind_gnd=s.set.v_wind, wind_dir=0.0, dt=1/s.set.sample_freq)

Calculates the next simulation step.

Parameters:

  • s: an instance of an abstract kite model
  • integrator: an integrator instance as returned by the function init_sim!
  • v_ro: reel out speed in m/s
  • v_wind_gnd: wind speed at reference height in m/s
  • wind_dir: wind direction in radians
  • dt: time step in seconds

Only the first two parameters are required.

Returns: The end time of the time step in seconds.

Low level simulation interface

KiteModels.clear!Function
clear!(s::KPS4)

Initialize the kite power model.

clear!(s::KPS3)

Initialize the kite power model.

KiteModels.find_steady_state!Function
find_steady_state!(s::KPS4; prn=false, delta = 0.0, stiffness_factor=0.035)

Find an initial equilibrium, based on the inital parameters l_tether, elevation and v_reel_out.

find_steady_state!(s::KPS3, prn=false, delta = 0.0, stiffness_factor=0.035)

Find an initial equilibrium, based on the inital parameters l_tether, elevation and v_reel_out.

KiteModels.residual!Function
residual!(res, yd, y::MVector{S, SimFloat}, s::KPS4, time) where S

N-point tether model, four points for the kite on top:
Inputs:
State vector y   = pos1,  pos2, ... , posn,  vel1,  vel2, . .., veln,  length, v_reel_out
Derivative   yd  = posd1, posd2, ..., posdn, veld1, veld2, ..., veldn, lengthd, v_reel_outd
Output:
Residual     res = res1, res2 = vel1-posd1,  ..., veld1-acc1, ...

Additional parameters:
s: Struct with work variables, type KPS4
S: The dimension of the state vector

The number of the point masses of the model N = S/6, the state of each point is represented by two 3 element vectors.

residual!(res, yd, y::MVector{S, SimFloat}, s::KPS3, time) where S

N-point tether model, one point kite at the top:
Inputs:
State vector y   = pos1, pos2, ..., posn, vel1, vel2, ..., veln
Derivative   yd  = vel1, vel2, ..., veln, acc1, acc2, ..., accn
Output:
Residual     res = res1, res2 = pos1,  ..., vel1, ...

Additional parameters:
s: Struct with work variables, type KPS3
S: The dimension of the state vector

The number of the point masses of the model N = S/6, the state of each point is represented by two 3 element vectors.

Environment

KiteModels.calc_rhoFunction
calc_rho(s::AKM, height)

Calculate the air densisity as function of height.

KiteModels.calc_wind_factorFunction
calc_wind_factor(s::AKM, height, profile_law=s.set.profile_law)

Calculate the relative wind speed at a given height and reference height.

Helper functions

KiteModels.copy_examplesFunction
copy_examples()

Copy the example scripts to the folder "examples" (it will be created if it doesn't exist).

KiteModels.copy_binFunction
copy_bin()

Copy the scripts createsysimage and run_julia to the folder "bin" (it will be created if it doesn't exist).

KiteModels.calc_dragFunction
calc_drag(s::KPS3, v_segment, unit_vector, rho, last_tether_drag, v_app_perp)

Calculate the drag of one tether segment, result stored in parameter last_tether_drag. Return the norm of the apparent wind velocity.

KiteModels.calc_set_cl_cd!Function
calc_set_cl_cd!(s::AKM, vec_c, v_app)

Calculate the lift over drag ratio as a function of the direction vector of the last tether segment, the current depower setting and the apparent wind speed. Set the calculated CL and CD values in the struct s.

KiteModels.calc_aero_forces!Function
calc_aero_forces!(s::KPS4, pos, vel, rho, alpha_depower, rel_steering)

Calculates the aerodynamic forces acting on the kite particles.

Parameters:

  • pos: vector of the particle positions
  • vel: vector of the particle velocities
  • rho: air density [kg/m^3]
  • rel_depower: value between 0.0 and 1.0
  • alpha_depower: depower angle [degrees]
  • rel_steering: value between -1.0 and +1.0

Updates the vector s.forces of the first parameter.

KiteModels.calc_particle_forces!Function
calc_particle_forces!(s::KPS4, pos1, pos2, vel1, vel2, spring, segments, d_tether, rho, i)

Calculate the drag force of the tether segment, defined by the parameters pos1, pos2, vel1 and vel2 and distribute it equally on the two particles, that are attached to the segment. The result is stored in the array s.forces.

KiteModels.initial_kite_ref_frameFunction
initial_kite_ref_frame(vec_c, v_app)

Calculate the initial orientation of the kite based on the last tether segment and the apparent wind speed.

Parameters:

  • vecc: (posn-2) - (pos_n-1) n: number of particles without the three kite particles that do not belong to the main thether (P1, P2 and P3).
  • v_app: vector of the apparent wind speed

Returns: x, y, z: the unit vectors of the kite reference frame in the ENU reference frame

KiteModels.inner_loop!Function
inner_loop!(s::KPS4, pos, vel, v_wind_gnd, segments, d_tether)

Calculate the forces, acting on all particles.

Output:

  • s.forces
  • s.v_wind_tether
KiteModels.loop!Function
loop!(s::KPS4, pos, vel, posd, veld)

Calculate the vectors s.res1 and calculate s.res2 using loops that iterate over all tether segments.

KiteModels.get_particlesFunction
get_particles(height_k, height_b, width, m_k, pos_pod= [ 75., 0., 129.90381057], vec_c=[-15., 0., -25.98076211], v_app=[10.4855, 0, -3.08324])

Calculate the initial positions of the particels representing a 4-point kite, connected to a kite control unit (KCU).

Parameters:

  • height_k: height of the kite itself, not above ground [m]
  • height_b: height of the bridle [m]
  • width: width of the kite [m]
  • mk: relative nose distance
  • pos_pod: position of the control pod
  • vec_c: vector of the last tether segment