From 7c172f83f1d53a6024b8d844edc6a6c89aee0873 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Tue, 17 Sep 2024 02:58:53 +0000 Subject: [PATCH] build based on f9676d1 --- dev/advanced/index.html | 2 +- dev/examples/index.html | 8 ++++---- dev/examples_4p/index.html | 2 +- dev/functions/index.html | 8 ++++---- dev/index.html | 2 +- dev/parameters/index.html | 2 +- dev/quickstart/index.html | 2 +- dev/search/index.html | 2 +- dev/search_index.js | 2 +- dev/types/index.html | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dev/advanced/index.html b/dev/advanced/index.html index 6f9745a2..122c49e5 100644 --- a/dev/advanced/index.html +++ b/dev/advanced/index.html @@ -79,4 +79,4 @@ julia>

A second run of this command needs about 5.5 s which means the startup time (load and compilation time of the package and the libraries) has been reduced to about 18.4s.

Without a system image the first time execution of the script "simulate_simple.jl" on the same computer is about 71 seconds while the time for the second execution is the same (5.5s). So now about 47s of time are saved after each restart.

Hints for Developers

Coding style

Bad: norm1 .~ norm(segment) Good: norm1 ~ norm(segment)

    tether_rhs        = [force_eqs[j, i].rhs for j in 1:3]
     kite_rhs          = [force_eqs[j, i+3].rhs for j in 1:3]
-    f_xy              = dot(tether_rhs, e_z) * e_z

Outlook

The next steps:

+ f_xy = dot(tether_rhs, e_z) * e_z

Outlook

The next steps:

diff --git a/dev/examples/index.html b/dev/examples/index.html index 8c8f785f..261bc7fb 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -8,9 +8,9 @@ st <BACKSPACE>

The command "st" was not really required, but it is useful to display which versions of the packages we have in our project. Another important package manager command is the command "up", which updates all packages to the latest compatible versions.

Then, copy the default configuration files and examples to your new project:

using KiteModels
 copy_settings()
-copy_examples()

The first command copies the files settings.yaml and system.yaml to the folder data. They can be customized later. The second command creates an examples folder with some examples.

Plotting the initial state

First, an instance of the model of the kite control unit (KCU) is created which is needed by the Kite Power System model KPS3. Then we create a kps instance, passing the kcu model as parameter. We need to declare these variables as const to achieve a decent performance.

using KiteModels
-const kcu = KCU(se())
-const kps = KPS3(kcu)

Then we call the function find_steady_state which uses a non-linear solver to find the solution for a given elevation angle, reel-out speed and wind speed.

find_steady_state!(kps, prn=true)

To plot the result in 2D we extract the vectors of the x and z coordinates of the tether particles with a for loop:

x = Float64[] 
+copy_examples()

The first command copies the files settings.yaml and system.yaml to the folder data. They can be customized later. The second command creates an examples folder with some examples.

Plotting the initial state

First, an instance of the model of the kite control unit (KCU) is created which is needed by the Kite Power System model KPS3. Then we create a kps instance, passing the kcu model as parameter. We need to declare the type these variables to achieve a decent performance.

using KiteModels
+kcu::KCU = KCU(se())
+kps::KPS3 = KPS3(kcu)

Then we call the function find_steady_state which uses a non-linear solver to find the solution for a given elevation angle, reel-out speed and wind speed.

find_steady_state!(kps, prn=true)

To plot the result in 2D we extract the vectors of the x and z coordinates of the tether particles with a for loop:

x = Float64[] 
 z = Float64[]
 for i in 1:length(kps.pos)
      push!(x, kps.pos[i][1])
@@ -50,4 +50,4 @@
 3-element StaticArrays.MVector{3, Float64} with indices SOneTo(3):
  12.54966091924401
   0.0
-  0.0

Example of reeling out the tether

include("examples/reel_out_1p.jl")

Reel out 1p model

In this example, we first keep the tether length constant and at 15 s start to reel out the winch with an acceleration of 0.1 m/s². At a set speed below 2.2 m/s the brake of the winch is active, therefore the "jump" in the v_reelout at the beginning of the reel-out phase.

It is not a real jump, but a high acceleration compared to the acceleration afterward.

+ 0.0

Example of reeling out the tether

include("examples/reel_out_1p.jl")

Reel out 1p model

In this example, we first keep the tether length constant and at 15 s start to reel out the winch with an acceleration of 0.1 m/s². At a set speed below 2.2 m/s the brake of the winch is active, therefore the "jump" in the v_reelout at the beginning of the reel-out phase.

It is not a real jump, but a high acceleration compared to the acceleration afterward.

diff --git a/dev/examples_4p/index.html b/dev/examples_4p/index.html index 5bb7cdb7..869fc0ba 100644 --- a/dev/examples_4p/index.html +++ b/dev/examples_4p/index.html @@ -63,4 +63,4 @@ 3-element StaticArrays.MVector{3, Float64} with indices SOneTo(3): 12.542508333667467 0.0 - 0.0

Example of reeling out the tether

include("examples/reel_out_4p.jl")

Reel out 4p model

In this example, we first keep the tether length constant and at 15 s start to reel out the winch with an acceleration of 0.1 m/s². At a set speed below 2.2 m/s the brake of the winch is active, therefore the "jump" in the v_reelout at the beginning of the reel-out phase.

It is not a real jump, but a high acceleration compared to the acceleration afterward.

+ 0.0

Example of reeling out the tether

include("examples/reel_out_4p.jl")

Reel out 4p model

In this example, we first keep the tether length constant and at 15 s start to reel out the winch with an acceleration of 0.1 m/s². At a set speed below 2.2 m/s the brake of the winch is active, therefore the "jump" in the v_reelout at the beginning of the reel-out phase.

It is not a real jump, but a high acceleration compared to the acceleration afterward.

diff --git a/dev/functions/index.html b/dev/functions/index.html index c1717ffc..7bc91dea 100644 --- a/dev/functions/index.html +++ b/dev/functions/index.html @@ -1,8 +1,8 @@ Functions · KiteModels.jl

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 KiteSimulators
 const s = KPS3(KCU(se()))

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

using KiteSimulators
-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_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.

source
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.

source

Output functions

KiteModels.unstretched_lengthFunction
unstretched_length(s::KPS4_3L)

Getter for the unstretched tether reel-out lenght (at zero force).

source
unstretched_length(s::AKM)

Getter for the unstretched tether reel-out lenght (at zero force).

source
KiteModels.tether_lengthFunction
tether_length(s::KPS4_3L)

Calculate and return the real, stretched tether lenght.

source
tether_length(s::AKM)

Calculate and return the real, stretched tether lenght.

source
KiteModels.pos_kiteFunction
pos_kite(s::KPS4)

Return the position of the kite (top particle).

source
pos_kite(s::KPS4_3L)

Return the position of the kite (top particle).

source
pos_kite(s::KPS3)

Return the position of the kite (top particle).

source
KiteModels.calc_heightFunction
calc_height(s::KPS4)

Determine the height of the topmost kite particle above ground.

source
calc_height(s::KPS4_3L)

Determine the height of the topmost kite particle above ground.

source
calc_height(s::KPS3)

Determine the height of the kite particle above ground.

source
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.

source
KiteModels.cl_cdFunction
cl_cd(s::KPS4)

Calculate the lift and drag coefficients of the kite, based on the current angles of attack.

source
KiteModels.winch_forceFunction
winch_force(s::KPS4)

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

source
winch_force(s::KPS4_3L)

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

source
winch_force(s::KPS3)

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

source
KiteModels.lift_dragFunction
lift_drag(s::AKM)

Return a tuple of the scalar lift and drag forces.

Example:

lift, drag = lift_drag(s)
source
KiteModels.kite_ref_frameFunction
kite_ref_frame(s::KPS4)

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

source
kite_ref_frame(s::KPS4_3L)

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

source
kite_ref_frame(s::KPS3)

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

source
KiteModels.orient_eulerFunction
orient_euler(s::AKM)

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

source
KiteUtils.SysStateType
SysState(s::AKM, zoom=1.0)

Constructor for creating a SysState object from a kite model (KPS3 or KPS4). The SysState object can be used either for logging or for displaying the system state in a viewer. Optionally the position arrays can be zoomed according to the requirements of the viewer.

source

High level simulation interface

KiteModels.init_sim!Function
init_sim!(s; t_end=1.0, stiffness_factor=1.0, 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
  • steadystatehistory: an instance of SteadyStateHistory containing old pairs of AKM objects and integrators

Returns: An instance of a DAE integrator.

source
init_sim!(s; t_end=1.0, stiffness_factor=0.035, delta=0.01, 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
  • delta: initial stretch of the tether during the steady state calculation
  • prn: if set to true, print the detailed solver results
  • steadystatehistory: an instance of SteadyStateHistory containing old pairs of AKM objects and integrators

Returns: An instance of a DAE integrator.

source
KiteModels.next_step!Function
next_step!(s::AKM, integrator; set_speed = nothing, set_torque=nothing, 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!
  • set_speed: set value of reel out speed in m/s or nothing
  • set_torque: set value of the torque in Nm or nothing
  • v_wind_gnd: wind speed at reference height in m/s
  • upwind_dir: upwind direction in radians, the direction the wind is coming from. Zero is at north; clockwise positive. Default: -pi/2, wind from west.
  • dt: time step in seconds

Either a value for set_speed or for set_torque required.

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

source

Low level simulation interface

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

Initialize the kite power model.

source
clear!(s::KPS4_3L)

Initialize the kite power model.

source
clear!(s::KPS3)

Initialize the kite power model.

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

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

source
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.

source
KiteModels.residual!Function
residual!(res, yd, y::MVector{S, SimFloat}, s::KPS4, time) where S
+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_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.

source
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.

source

Output functions

KiteModels.unstretched_lengthFunction
unstretched_length(s::KPS4_3L)

Getter for the unstretched tether reel-out lenght (at zero force).

source
unstretched_length(s::AKM)

Getter for the unstretched tether reel-out lenght (at zero force).

source
KiteModels.tether_lengthFunction
tether_length(s::KPS4_3L)

Calculate and return the real, stretched tether lenght.

source
tether_length(s::AKM)

Calculate and return the real, stretched tether lenght.

source
KiteModels.pos_kiteFunction
pos_kite(s::KPS4)

Return the position of the kite (top particle).

source
pos_kite(s::KPS4_3L)

Return the position of the kite (top particle).

source
pos_kite(s::KPS3)

Return the position of the kite (top particle).

source
KiteModels.calc_heightFunction
calc_height(s::KPS4)

Determine the height of the topmost kite particle above ground.

source
calc_height(s::KPS4_3L)

Determine the height of the topmost kite particle above ground.

source
calc_height(s::KPS3)

Determine the height of the kite particle above ground.

source
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.

source
KiteModels.cl_cdFunction
cl_cd(s::KPS4)

Calculate the lift and drag coefficients of the kite, based on the current angles of attack.

source
KiteModels.winch_forceFunction
winch_force(s::KPS4)

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

source
winch_force(s::KPS4_3L)

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

source
winch_force(s::KPS3)

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

source
KiteModels.lift_dragFunction
lift_drag(s::AKM)

Return a tuple of the scalar lift and drag forces.

Example:

lift, drag = lift_drag(s)
source
KiteModels.kite_ref_frameFunction
kite_ref_frame(s::KPS4)

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

source
kite_ref_frame(s::KPS4_3L)

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

source
kite_ref_frame(s::KPS3)

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

source
KiteModels.orient_eulerFunction
orient_euler(s::AKM)

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

source
KiteUtils.SysStateType
SysState(s::AKM, zoom=1.0)

Constructor for creating a SysState object from a kite model (KPS3 or KPS4). The SysState object can be used either for logging or for displaying the system state in a viewer. Optionally the position arrays can be zoomed according to the requirements of the viewer.

source

High level simulation interface

KiteModels.init_sim!Function
init_sim!(s; t_end=1.0, stiffness_factor=1.0, 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
  • steadystatehistory: an instance of SteadyStateHistory containing old pairs of AKM objects and integrators

Returns: An instance of a DAE integrator.

source
init_sim!(s; t_end=1.0, stiffness_factor=0.035, delta=0.01, 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
  • delta: initial stretch of the tether during the steady state calculation
  • prn: if set to true, print the detailed solver results
  • steadystatehistory: an instance of SteadyStateHistory containing old pairs of AKM objects and integrators

Returns: An instance of a DAE integrator.

source
KiteModels.next_step!Function
next_step!(s::AKM, integrator; set_speed = nothing, set_torque=nothing, 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!
  • set_speed: set value of reel out speed in m/s or nothing
  • set_torque: set value of the torque in Nm or nothing
  • v_wind_gnd: wind speed at reference height in m/s
  • upwind_dir: upwind direction in radians, the direction the wind is coming from. Zero is at north; clockwise positive. Default: -pi/2, wind from west.
  • dt: time step in seconds

Either a value for set_speed or for set_torque required.

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

source

Low level simulation interface

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

Initialize the kite power model.

source
clear!(s::KPS4_3L)

Initialize the kite power model.

source
clear!(s::KPS3)

Initialize the kite power model.

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

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

source
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.

source
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:
@@ -13,7 +13,7 @@
 
 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.

source
residual!(res, yd, y::MVector{S, SimFloat}, s::KPS3, time) where S
+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.

source
residual!(res, yd, y::MVector{S, SimFloat}, s::KPS3, time) where S
 
 N-point tether model, one point kite at the top:
 Inputs:
@@ -24,4 +24,4 @@
 
 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.

source

Helper functions

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).

source
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.

source
KiteModels.calc_set_cl_cd!Function
calc_set_cl_cd!(s::KPS3, 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.

source
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.

source
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.

source
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
source
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.

source
+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.

source

Helper functions

KiteModels.copy_examplesFunction
copy_examples()

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

source
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).

source
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.

source
KiteModels.calc_set_cl_cd!Function
calc_set_cl_cd!(s::KPS3, 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.

source
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.

source
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.

source
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
source
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.

source
diff --git a/dev/index.html b/dev/index.html index 9e1f357b..e90763d1 100644 --- a/dev/index.html +++ b/dev/index.html @@ -3,4 +3,4 @@ cd test julia --project="."

Now add KiteModels from Julia's package manager, by typing

using Pkg
 pkg"add KiteModels"

at the Julia prompt. You can run the unit tests with the command:

pkg"test KiteModels"

You can copy the examples to your project with:

using KiteModels
-KiteModels.install_examples()

This also adds the extra packages, needed for the examples to the project. Furthermore, it creates a folder data with some example input files. You can now run the examples with the command:

include("examples/menu.jl")

News

August 2024

July 2024

April 2024

Provides

The type AbstractKiteModel with the implementation KPS3, KPS4 and KPS4_3L, representing the one point, the four point kite model and the four point - three lines model, together with the high level simulation interface consisting of the functions init_sim! and next_step!. Other kite models can be added inside or outside of this package by implementing the non-generic methods required for an AbstractKiteModel.

Additional functions to provide inputs and outputs of the model on each time step. In particular the constructor SysState can be called once per time step to create a SysState struct for logging or for displaying the state in a viewer. Per time step the residual! function is called as many times as needed to find the solution at the end of the time step. The formulas are based on basic physics and aerodynamics and can be quite simple because a differential algebraic notation is used.

Four point kite power system model

Reference frames and control inputs

A definition of the reference frames can be found here .

Further reading

The one point and four point kite models are described in detail in Dynamic Model of a Pumping Kite Power System.

See also

Authors: Uwe Fechner (uwe.fechner.msc@gmail.com) and Bart van de Lint

+KiteModels.install_examples()

This also adds the extra packages, needed for the examples to the project. Furthermore, it creates a folder data with some example input files. You can now run the examples with the command:

include("examples/menu.jl")

News

August 2024

July 2024

April 2024

Provides

The type AbstractKiteModel with the implementation KPS3, KPS4 and KPS4_3L, representing the one point, the four point kite model and the four point - three lines model, together with the high level simulation interface consisting of the functions init_sim! and next_step!. Other kite models can be added inside or outside of this package by implementing the non-generic methods required for an AbstractKiteModel.

Additional functions to provide inputs and outputs of the model on each time step. In particular the constructor SysState can be called once per time step to create a SysState struct for logging or for displaying the state in a viewer. Per time step the residual! function is called as many times as needed to find the solution at the end of the time step. The formulas are based on basic physics and aerodynamics and can be quite simple because a differential algebraic notation is used.

Four point kite power system model

Reference frames and control inputs

A definition of the reference frames can be found here .

Further reading

The one point and four point kite models are described in detail in Dynamic Model of a Pumping Kite Power System.

See also

Authors: Uwe Fechner (uwe.fechner.msc@gmail.com) and Bart van de Lint

diff --git a/dev/parameters/index.html b/dev/parameters/index.html index 1b4d5b86..dffd3751 100644 --- a/dev/parameters/index.html +++ b/dev/parameters/index.html @@ -65,4 +65,4 @@ rho_0: 1.225 # air density at the ground or zero [kg/m³] alpha: 0.08163 # exponent of the wind profile law z0: 0.0002 # surface roughness [m] - profile_law: 6 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG + profile_law: 6 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG diff --git a/dev/quickstart/index.html b/dev/quickstart/index.html index 1471e335..7b1baab2 100644 --- a/dev/quickstart/index.html +++ b/dev/quickstart/index.html @@ -42,4 +42,4 @@ PRINT = false STATISTIC = false

Now you can quit Julia with the command exit(). If you want to launch Julia again, be sure to be in the correct folder and then type julia --project. Without the parameter --project it will not load your project settings.

The first run of the script will be slow because Julia must compile the code. The second and any further run is very fast, but only as long as you do not leave your Julia session.

Comparing the one-point and the four-point kite model

Start Julia in the project folder you created before:

cd test
 julia --project

and then execute the command

using KiteModels
-include("examples/compare_kps3_kps4.jl")

Use the command include("examples\\compare_kps3_kps4.jl") on Windows.

The last view of the animation should look like this:

Initial State

You can save what you see with the command savefig("kite.png").

Exercise

Modify the variable ALPHA_ZERO in line 11 of the script until the lift force of the 1 point model and the 4 point model match.

Questions?

If you have any questions, please ask in the Julia Discourse forum in the section modelling and simulation , or in in the section First steps . The Julia community is very friendly and responsive.

+include("examples/compare_kps3_kps4.jl")

Use the command include("examples\\compare_kps3_kps4.jl") on Windows.

The last view of the animation should look like this:

Initial State

You can save what you see with the command savefig("kite.png").

Exercise

Modify the variable ALPHA_ZERO in line 11 of the script until the lift force of the 1 point model and the 4 point model match.

Questions?

If you have any questions, please ask in the Julia Discourse forum in the section modelling and simulation , or in in the section First steps . The Julia community is very friendly and responsive.

diff --git a/dev/search/index.html b/dev/search/index.html index 4a579833..ad9deeed 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · KiteModels.jl

Loading search...

    +Search · KiteModels.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index f22f91ba..2da635f8 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"functions/","page":"Functions","title":"Functions","text":"CurrentModule = KiteModels","category":"page"},{"location":"functions/#Introduction","page":"Functions","title":"Introduction","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"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:","category":"page"},{"location":"functions/","page":"Functions","title":"Functions","text":"using KiteSimulators\nconst s = KPS3(KCU(se()))","category":"page"},{"location":"functions/","page":"Functions","title":"Functions","text":"Or, if you want to use the 4 point kite model:","category":"page"},{"location":"functions/","page":"Functions","title":"Functions","text":"using KiteSimulators\nconst s = KPS4(KCU(se()))","category":"page"},{"location":"functions/","page":"Functions","title":"Functions","text":"Functions with an \"!\" as last character of the function name modify one of more of their parameters, in this context mostly the variable s.","category":"page"},{"location":"functions/#Input-functions","page":"Functions","title":"Input functions","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"set_depower_steering!\nset_v_wind_ground!","category":"page"},{"location":"functions/#KiteModels.set_depower_steering!","page":"Functions","title":"KiteModels.set_depower_steering!","text":"set_depower_steering!(s::AKM, depower, steering)\n\nSetter for the depower and steering model inputs. \n\nParameters:\n\ndepower: Relative depower, must be between 0 .. 1.0\nsteering: Relative steering, must be between -1.0 .. 1.0. \n\nThis function sets the variables s.depower, s.steering and s.alpha_depower. \n\nIt takes the depower offset c0 and the dependency of the steering sensitivity from the depower settings into account.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.set_v_wind_ground!","page":"Functions","title":"KiteModels.set_v_wind_ground!","text":"set_v_wind_ground!(s::AKM, height, v_wind_gnd=s.set.v_wind, wind_dir=0.0)\n\nSet 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.\n\n\n\n\n\n","category":"function"},{"location":"functions/#Output-functions","page":"Functions","title":"Output functions","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"unstretched_length\ntether_length\npos_kite\ncalc_height\ncalc_elevation\ncalc_azimuth\ncalc_heading\ncalc_course\ncl_cd\nwinch_force\nspring_forces\nlift_drag\nlift_over_drag\nv_wind_kite\nkite_ref_frame\norient_euler\nSysState","category":"page"},{"location":"functions/#KiteModels.unstretched_length","page":"Functions","title":"KiteModels.unstretched_length","text":"unstretched_length(s::KPS4_3L)\n\nGetter for the unstretched tether reel-out lenght (at zero force).\n\n\n\n\n\nunstretched_length(s::AKM)\n\nGetter for the unstretched tether reel-out lenght (at zero force).\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.tether_length","page":"Functions","title":"KiteModels.tether_length","text":"tether_length(s::KPS4_3L)\n\nCalculate and return the real, stretched tether lenght.\n\n\n\n\n\ntether_length(s::AKM)\n\nCalculate and return the real, stretched tether lenght.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.pos_kite","page":"Functions","title":"KiteModels.pos_kite","text":"pos_kite(s::KPS4)\n\nReturn the position of the kite (top particle).\n\n\n\n\n\npos_kite(s::KPS4_3L)\n\nReturn the position of the kite (top particle).\n\n\n\n\n\npos_kite(s::KPS3)\n\nReturn the position of the kite (top particle).\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_height","page":"Functions","title":"KiteModels.calc_height","text":"calc_height(s::KPS4)\n\nDetermine the height of the topmost kite particle above ground.\n\n\n\n\n\ncalc_height(s::KPS4_3L)\n\nDetermine the height of the topmost kite particle above ground.\n\n\n\n\n\ncalc_height(s::KPS3)\n\nDetermine the height of the kite particle above ground.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.calc_elevation","page":"Functions","title":"KiteUtils.calc_elevation","text":"calc_elevation(s::AKM)\n\nDetermine the elevation angle of the kite in radian.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.calc_azimuth","page":"Functions","title":"KiteUtils.calc_azimuth","text":"calc_azimuth(s::AKM)\n\nDetermine the azimuth angle of the kite in radian.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.calc_heading","page":"Functions","title":"KiteUtils.calc_heading","text":"calc_heading(s::AKM)\n\nDetermine the heading angle of the kite in radian.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.calc_course","page":"Functions","title":"KiteUtils.calc_course","text":"calc_course(s::AKM)\n\nDetermine the course angle of the kite in radian. Undefined if the velocity of the kite is near zero.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.cl_cd","page":"Functions","title":"KiteModels.cl_cd","text":"cl_cd(s::KPS4)\n\nCalculate the lift and drag coefficients of the kite, based on the current angles of attack.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.winch_force","page":"Functions","title":"KiteModels.winch_force","text":"winch_force(s::KPS4)\n\nReturn the absolute value of the force at the winch as calculated during the last timestep. \n\n\n\n\n\nwinch_force(s::KPS4_3L)\n\nReturn the absolute value of the force at the winch as calculated during the last timestep. \n\n\n\n\n\nwinch_force(s::KPS3)\n\nReturn the absolute value of the force at the winch as calculated during the last timestep. \n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.spring_forces","page":"Functions","title":"KiteModels.spring_forces","text":"spring_forces(s::AKM)\n\nReturn an array of the scalar spring forces of all tether segements.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.lift_drag","page":"Functions","title":"KiteModels.lift_drag","text":"lift_drag(s::AKM)\n\nReturn a tuple of the scalar lift and drag forces. \n\nExample: \n\nlift, drag = lift_drag(s)\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.lift_over_drag","page":"Functions","title":"KiteModels.lift_over_drag","text":"lift_over_drag(s::AKM)\n\nReturn the lift-over-drag ratio.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.v_wind_kite","page":"Functions","title":"KiteModels.v_wind_kite","text":"v_wind_kite(s::AKM)\n\nReturn the vector of the wind speed at the height of the kite.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.kite_ref_frame","page":"Functions","title":"KiteModels.kite_ref_frame","text":"kite_ref_frame(s::KPS4)\n\nReturns a tuple of the x, y, and z vectors of the kite reference frame.\n\n\n\n\n\nkite_ref_frame(s::KPS4_3L)\n\nReturns a tuple of the x, y, and z vectors of the kite reference frame.\n\n\n\n\n\nkite_ref_frame(s::KPS3)\n\nReturns a tuple of the x, y, and z vectors of the kite reference frame.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.orient_euler","page":"Functions","title":"KiteModels.orient_euler","text":"orient_euler(s::AKM)\n\nCalculate and return the orientation of the kite in euler angles (roll, pitch, yaw) as SVector. \n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.SysState","page":"Functions","title":"KiteUtils.SysState","text":"SysState(s::AKM, zoom=1.0)\n\nConstructor for creating a SysState object from a kite model (KPS3 or KPS4). The SysState object can be used either for logging or for displaying the system state in a viewer. Optionally the position arrays can be zoomed according to the requirements of the viewer.\n\n\n\n\n\n","category":"type"},{"location":"functions/#High-level-simulation-interface","page":"Functions","title":"High level simulation interface","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"init_sim!\nnext_step!","category":"page"},{"location":"functions/#KiteModels.init_sim!","page":"Functions","title":"KiteModels.init_sim!","text":"init_sim!(s; t_end=1.0, stiffness_factor=1.0, prn=false)\n\nInitialises the integrator of the model.\n\nParameters:\n\ns: an instance of an abstract kite model\nt_end: end time of the simulation; normally not needed\nstiffness_factor: factor applied to the tether stiffness during initialisation\nprn: if set to true, print the detailed solver results\nsteadystatehistory: an instance of SteadyStateHistory containing old pairs of AKM objects and integrators\n\nReturns: An instance of a DAE integrator.\n\n\n\n\n\ninit_sim!(s; t_end=1.0, stiffness_factor=0.035, delta=0.01, prn=false)\n\nInitialises the integrator of the model.\n\nParameters:\n\ns: an instance of an abstract kite model\nt_end: end time of the simulation; normally not needed\nstiffness_factor: factor applied to the tether stiffness during initialisation\ndelta: initial stretch of the tether during the steady state calculation\nprn: if set to true, print the detailed solver results\nsteadystatehistory: an instance of SteadyStateHistory containing old pairs of AKM objects and integrators\n\nReturns: An instance of a DAE integrator.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.next_step!","page":"Functions","title":"KiteModels.next_step!","text":"next_step!(s::AKM, integrator; set_speed = nothing, set_torque=nothing, v_wind_gnd=s.set.v_wind, wind_dir=0.0, \n dt=1/s.set.sample_freq)\n\nCalculates the next simulation step.\n\nParameters:\n\ns: an instance of an abstract kite model\nintegrator: an integrator instance as returned by the function init_sim!\nset_speed: set value of reel out speed in m/s or nothing\nset_torque: set value of the torque in Nm or nothing\nv_wind_gnd: wind speed at reference height in m/s\nupwind_dir: upwind direction in radians, the direction the wind is coming from. Zero is at north; clockwise positive. Default: -pi/2, wind from west.\ndt: time step in seconds\n\nEither a value for set_speed or for set_torque required.\n\nReturns: The end time of the time step in seconds.\n\n\n\n\n\n","category":"function"},{"location":"functions/#Low-level-simulation-interface","page":"Functions","title":"Low level simulation interface","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"clear!\nfind_steady_state!\nresidual!","category":"page"},{"location":"functions/#KiteModels.clear!","page":"Functions","title":"KiteModels.clear!","text":"clear!(s::KPS4)\n\nInitialize the kite power model.\n\n\n\n\n\nclear!(s::KPS4_3L)\n\nInitialize the kite power model.\n\n\n\n\n\nclear!(s::KPS3)\n\nInitialize the kite power model.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.find_steady_state!","page":"Functions","title":"KiteModels.find_steady_state!","text":"find_steady_state!(s::KPS4; prn=false, delta = 0.01, stiffness_factor=0.035)\n\nFind an initial equilibrium, based on the inital parameters l_tether, elevation and v_reel_out.\n\n\n\n\n\nfind_steady_state!(s::KPS3, prn=false, delta = 0.0, stiffness_factor=0.035)\n\nFind an initial equilibrium, based on the inital parameters l_tether, elevation and v_reel_out.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.residual!","page":"Functions","title":"KiteModels.residual!","text":"residual!(res, yd, y::MVector{S, SimFloat}, s::KPS4, time) where S\n\nN-point tether model, four points for the kite on top:\nInputs:\nState vector y = pos1, pos2, ... , posn, vel1, vel2, . .., veln, length, v_reel_out\nDerivative yd = posd1, posd2, ..., posdn, veld1, veld2, ..., veldn, lengthd, v_reel_outd\nOutput:\nResidual res = res1, res2 = vel1-posd1, ..., veld1-acc1, ..., \n\nAdditional parameters:\ns: Struct with work variables, type KPS4\nS: The dimension of the state vector\n\nThe number of the point masses of the model N = S/6, the state of each point is represented by two 3 element vectors.\n\n\n\n\n\nresidual!(res, yd, y::MVector{S, SimFloat}, s::KPS3, time) where S\n\nN-point tether model, one point kite at the top:\nInputs:\nState vector y = pos1, pos2, ..., posn, vel1, vel2, ..., veln\nDerivative yd = vel1, vel2, ..., veln, acc1, acc2, ..., accn\nOutput:\nResidual res = res1, res2 = pos1, ..., vel1, ...\n\nAdditional parameters:\ns: Struct with work variables, type KPS3\nS: The dimension of the state vector\n\nThe number of the point masses of the model N = S/6, the state of each point is represented by two 3 element vectors.\n\n\n\n\n\n","category":"function"},{"location":"functions/#Helper-functions","page":"Functions","title":"Helper functions","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"copy_examples\ncopy_bin\ncalc_drag\ncalc_set_cl_cd!\ncalc_aero_forces!\ncalc_particle_forces!\ninner_loop!\nloop!","category":"page"},{"location":"functions/#KiteModels.copy_examples","page":"Functions","title":"KiteModels.copy_examples","text":"copy_examples()\n\nCopy all example scripts to the folder \"examples\" (it will be created if it doesn't exist).\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.copy_bin","page":"Functions","title":"KiteModels.copy_bin","text":"copy_bin()\n\nCopy the scripts createsysimage and run_julia to the folder \"bin\" (it will be created if it doesn't exist).\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_drag","page":"Functions","title":"KiteModels.calc_drag","text":"calc_drag(s::KPS3, v_segment, unit_vector, rho, last_tether_drag, v_app_perp)\n\nCalculate the drag of one tether segment, result stored in parameter last_tether_drag. Return the norm of the apparent wind velocity.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_set_cl_cd!","page":"Functions","title":"KiteModels.calc_set_cl_cd!","text":"calc_set_cl_cd!(s::KPS3, vec_c, v_app)\n\nCalculate 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. \n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_aero_forces!","page":"Functions","title":"KiteModels.calc_aero_forces!","text":"calc_aero_forces!(s::KPS4, pos, vel, rho, alpha_depower, rel_steering)\n\nCalculates the aerodynamic forces acting on the kite particles.\n\nParameters:\n\npos: vector of the particle positions\nvel: vector of the particle velocities\nrho: air density [kg/m^3]\nrel_depower: value between 0.0 and 1.0\nalpha_depower: depower angle [degrees]\nrel_steering: value between -1.0 and +1.0\n\nUpdates the vector s.forces of the first parameter.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_particle_forces!","page":"Functions","title":"KiteModels.calc_particle_forces!","text":"calc_particle_forces!(s::KPS4, pos1, pos2, vel1, vel2, spring, segments, d_tether, rho, i)\n\nCalculate 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. \n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.inner_loop!","page":"Functions","title":"KiteModels.inner_loop!","text":"inner_loop!(s::KPS4, pos, vel, v_wind_gnd, segments, d_tether)\n\nCalculate the forces, acting on all particles.\n\nOutput:\n\ns.forces\ns.v_wind_tether\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.loop!","page":"Functions","title":"KiteModels.loop!","text":"loop!(s::KPS4, pos, vel, posd, veld)\n\nCalculate the vectors s.res1 and calculate s.res2 using loops that iterate over all tether segments. \n\n\n\n\n\n","category":"function"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"CurrentModule = KiteModels","category":"page"},{"location":"quickstart/#Quickstart","page":"Quickstart","title":"Quickstart","text":"","category":"section"},{"location":"quickstart/#Installation-of-Julia","page":"Quickstart","title":"Installation of Julia","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"For a quick test of this program, it is NOT needed to install VSCode, git or bash. Just installing Julia is sufficient, and that can be done in a few minutes. ","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      \n Windows","category":"page"},{"location":"quickstart/#Windows","page":"Quickstart","title":"Windows","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Please download and install Julia using juliaup. Launch the Command Prompt app and type:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"winget install julia -s msstore\njuliaup add 1.10\njuliaup update","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"If that doesn't work, download https://install.julialang.org/Julia.appinstaller and double-click on the downloaded file to install it.","category":"page"},{"location":"quickstart/#Optional","page":"Quickstart","title":"Optional","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"It is suggested to install Windows Terminal . Copy and paste works better, unicode works much better and you can use it with bash or Command Prompt, whatever you prefer. It is suggested to set one of these two as default using the Settings menu of Windows Terminal.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      ","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      \n Linux","category":"page"},{"location":"quickstart/#Linux","page":"Quickstart","title":"Linux","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Copy and past the following line to install julia:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"curl -fsSL https://install.julialang.org | sh","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Restart your terminal, and then execute:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"juliaup add 1.10\njuliaup update","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"It is suggested to add the following line to your .bashrc file:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"alias jl='./bin/run_julia'","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"This makes it possible to run Julia with the shortcut jl later.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      ","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      \n Mac","category":"page"},{"location":"quickstart/#Mac","page":"Quickstart","title":"Mac","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Please download and install juliaup as explained at https://github.com/JuliaLang/juliaup .","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Restart your terminal, and then execute:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"juliaup add 1.10\njuliaup update","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      ","category":"page"},{"location":"quickstart/#Create-a-test-project","page":"Quickstart","title":"Create a test project","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Launch a command prompt and create a folder with the name \"test\":","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"mkdir test\ncd test\njulia --project=\".\"","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"With the last command, we told Julia to create a new project in the current directory.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Then we add the three required packages to our new project. By pressing the key \"]\" we enter the package manager mode where we can add or delete packages.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"]\nadd KiteUtils\nadd KitePodModels\nadd KiteModels\nadd ControlPlots\nst\n","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"The command \"st\" was not really required, but it is useful to display which versions of the packages we have in our project. Another important package manager command is the command \"up\", which updates all packages to the latest compatible versions.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Then, copy the default configuration files and examples to your new project:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"using KiteModels\ncopy_settings()\ncopy_examples()","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"The first command copies the files settings.yaml and system.yaml to the folder data. They can be customized later. The second command creates an examples folder with some examples.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Your folder structure should now look like this:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"shell> tree\n.\n├── data\n│   ├── kite.obj\n│   ├── settings.yaml\n│   └── system.yaml\n├── examples\n│   ├── bench.jl\n│   ├── compare_kps3_kps4.jl\n│   ├── menu.jl\n│   ├── reel_out_1p.jl\n│   ├── reel_out_4p.jl\n│   ├── reel_out_4p_torque_control.jl\n│   ├── simulate_simple.jl\n│   └── simulate_steering.jl\n├── Manifest.toml\n└── Project.toml\n\n2 directories, 7 files","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"You can access the operating system command line by typing the character \";\", you then get a \"shell\" prompt and can enter operating system commands. To leave shell mode, type \\. On windows you need to type tree /f instead of tree to see the files.","category":"page"},{"location":"quickstart/#Executing-the-first-example","page":"Quickstart","title":"Executing the first example","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"From the Julia prompt you can use the command \"include\" to execute a script:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"include(\"examples/simulate_simple.jl\")","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"On Windows you need to type \"\\\\\" instead of \"/\":","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"include(\"examples\\\\simulate_simple.jl\")","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"You will see the 4-point kite fly for 30s. If you want to change the settings of the simulation, open the file simulate_simple.jlin your favorite text editor, modify the settings at the beginning of the file and execute the include command again. You can use the key for autocompletion, for exampleinclude(exTABcompletes toinclude(examples` which can save a lot of typing. If you type again you get a list of files to choose from.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Try out changing the following default settings:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"dt = 0.05\nSTEPS = 600\nPLOT = true\nFRONT_VIEW = false\nZOOM = true\nPRINT = false\nSTATISTIC = false","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Now you can quit Julia with the command exit(). If you want to launch Julia again, be sure to be in the correct folder and then type julia --project. Without the parameter --project it will not load your project settings.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"The first run of the script will be slow because Julia must compile the code. The second and any further run is very fast, but only as long as you do not leave your Julia session.","category":"page"},{"location":"quickstart/#Comparing-the-one-point-and-the-four-point-kite-model","page":"Quickstart","title":"Comparing the one-point and the four-point kite model","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Start Julia in the project folder you created before:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"cd test\njulia --project","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"and then execute the command","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"using KiteModels\ninclude(\"examples/compare_kps3_kps4.jl\")","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Use the command include(\"examples\\\\compare_kps3_kps4.jl\") on Windows.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"The last view of the animation should look like this:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"(Image: Initial State)","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"You can save what you see with the command savefig(\"kite.png\").","category":"page"},{"location":"quickstart/#Exercise","page":"Quickstart","title":"Exercise","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Modify the variable ALPHA_ZERO in line 11 of the script until the lift force of the 1 point model and the 4 point model match.","category":"page"},{"location":"quickstart/#Questions?","page":"Quickstart","title":"Questions?","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"If you have any questions, please ask in the Julia Discourse forum in the section modelling and simulation , or in in the section First steps . The Julia community is very friendly and responsive.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"CurrentModule = KiteModels","category":"page"},{"location":"examples/#Examples-for-using-the-one-point-kite-model","page":"Examples_1p","title":"Examples for using the one point kite model","text":"","category":"section"},{"location":"examples/#Create-a-test-project","page":"Examples_1p","title":"Create a test project","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"mkdir test\ncd test\njulia --project=\".\"","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"With the last command, we told Julia to create a new project in the current directory.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Then we add the three required packages to our new project. By pressing the key \"]\" we enter the package manager mode where we can add or delete packages.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"]\nadd KiteUtils\nadd KitePodModels\nadd KiteModels\nst\n","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"The command \"st\" was not really required, but it is useful to display which versions of the packages we have in our project. Another important package manager command is the command \"up\", which updates all packages to the latest compatible versions.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Then, copy the default configuration files and examples to your new project:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"using KiteModels\ncopy_settings()\ncopy_examples()","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"The first command copies the files settings.yaml and system.yaml to the folder data. They can be customized later. The second command creates an examples folder with some examples.","category":"page"},{"location":"examples/#Plotting-the-initial-state","page":"Examples_1p","title":"Plotting the initial state","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"First, an instance of the model of the kite control unit (KCU) is created which is needed by the Kite Power System model KPS3. Then we create a kps instance, passing the kcu model as parameter. We need to declare these variables as const to achieve a decent performance.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"using KiteModels\nconst kcu = KCU(se())\nconst kps = KPS3(kcu)","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Then we call the function find_steady_state which uses a non-linear solver to find the solution for a given elevation angle, reel-out speed and wind speed. ","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"find_steady_state!(kps, prn=true)","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"To plot the result in 2D we extract the vectors of the x and z coordinates of the tether particles with a for loop:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"x = Float64[] \nz = Float64[]\nfor i in 1:length(kps.pos)\n push!(x, kps.pos[i][1])\n push!(z, kps.pos[i][3])\nend","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"And finally, we plot the position of the particles in the x-z plane. When you type using ControlPlots you will be asked if you want to install the ControlPlots package. Just press \\ and it gets installed.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"using ControlPlots\nplot(x,z, xlabel=\"x [m]\", ylabel=\"z [m]\", scatter=true)","category":"page"},{"location":"examples/#Inital-State","page":"Examples_1p","title":"Inital State","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"(Image: Initial State)","category":"page"},{"location":"examples/#Print-other-model-outputs","page":"Examples_1p","title":"Print other model outputs","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the vector of the positions of the particles:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> kps.pos\n7-element StaticArrays.SVector{7, StaticArrays.MVector{3, Float64}} with indices SOneTo(7):\n [0.0, 0.0, 0.0]\n [26.95751778658999, 0.0, 59.59749511924355]\n [51.97088814144287, 0.0, 120.03746888266994]\n [75.01423773175357, 0.0, 181.25637381120865]\n [96.06809940556136, 0.0, 243.18841293054678]\n [115.11959241520753, 0.0, 305.7661763854397]\n [132.79571663189674, 0.0, 368.74701279158705]\n","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the unstretched and stretched tether length and the height of the kite:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> unstretched_length(kps)\n150.0\n\njulia> tether_length(kps)\n150.1461801769623\n\njulia> calc_height(kps)\n142.78102261557189","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the force at the winch (groundstation, in Newton) and at each tether segment:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> winch_force(kps)\n592.5649922210812\n\njulia> spring_forces(kps)\n6-element Vector{Float64}:\n 592.5534481632459\n 595.0953689567787\n 597.6497034999358\n 600.215921248686\n 602.793488771366\n 605.3855398009119","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"The force increases when going upwards because the kite not only experiences the winch force but in addition the weight of the tether.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the lift and drag forces of the kite (in Newton) and the lift-over-drag ratio:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> lift, drag = lift_drag(kps)\n(730.5877517655691, 157.36420900755007)\n\njulia> lift_over_drag(kps)\n4.64265512706588","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the wind speed vector at the kite:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> v_wind_kite(kps)\n3-element StaticArrays.MVector{3, Float64} with indices SOneTo(3):\n 12.54966091924401\n 0.0\n 0.0","category":"page"},{"location":"examples/#Example-of-reeling-out-the-tether","page":"Examples_1p","title":"Example of reeling out the tether","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"include(\"examples/reel_out_1p.jl\")","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"(Image: Reel out 1p model)","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"In this example, we first keep the tether length constant and at 15 s start to reel out the winch with an acceleration of 0.1 m/s². At a set speed below 2.2 m/s the brake of the winch is active, therefore the \"jump\" in the v_reelout at the beginning of the reel-out phase.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"It is not a real jump, but a high acceleration compared to the acceleration afterward.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"CurrentModule = KiteModels","category":"page"},{"location":"advanced/#Advanced-usage","page":"Advanced usage","title":"Advanced usage","text":"","category":"section"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"For advanced users it is suggested to install git, bash and vscode or vscodium in addition to Julia. vscode and vscodium both have a very good plugin for Julia support, see https://www.julia-vscode.org. For Windows users, you can find some installation instructions here: Julia on Windows .","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Whe using vscode, I do NOT use the Julia terminal provided by vscode, but the normal bash terminal which is also available in vscode by selecting Terminal->New Terminal From this terminal I start Julia with julia --project or a different command as explained below. This makes it easier to understand what happens and is also faster when you need to restart.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"For Ubuntu Linux I use the following ppa to install vscode and to keep it up-to-date: https://www.ubuntuupdates.org/ppa/vscode .","category":"page"},{"location":"advanced/#Creating-a-custom-system-image","page":"Advanced usage","title":"Creating a custom system image","text":"","category":"section"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"To reduce the startup time it is suggested to use a custom system image that contains all the packages you use on a daily base in compiled form.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"For end users, follow the instructions on KiteSimulators . Package developers can follow these instructions:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Go to the website https://github.com/ufechner7/KiteModels.jl and click on the Fork button at the top right.\nclone the new repository which is owned by you with a command similar to this one: git clone https://github.com/aenarete/KiteModels.jl Your own git user name must appear in the URL, otherwise you will not be able to push your changes.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"From a bash prompt you can create one using the following commands, assuming you created a folder \"test\" as explained on the Quickstart page:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"cd KiteModels.jl\njulia --project","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"using Pkg\nPkg.instantiate()\nPkg.precompile()","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"If you enter shell mode by pressing \";\" and type the command treeyou should see the following files:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"shell> tree\n.\n├── bin\n│   ├── create_sys_image\n│   ├── create_sys_image2\n│   ├── run_julia\n│   └── run_julia2\n├── data\n│   ├── settings.yaml\n│   └── system.yaml\n├── docs\n│   ├── data\n│   ├── make.jl\n│   ├── Project.toml\n│   └── src\n│   ├── 4-point-kite.png\n│   ├── advanced.md\n│   ├── assets\n│   │   └── logo.png\n│   ├── examples_4p.md\n│   ├── examples.md\n│   ├── functions.md\n│   ├── index.md\n│   ├── initial_state_4p.png\n│   ├── initial_state.png\n│   ├── kite.png\n│   ├── kite_power_tools.png\n│   ├── kps4_hires.png\n│   ├── kps4.png\n│   ├── parameters.md\n│   ├── quickstart.md\n│   └── types.md\n├── examples\n│   ├── compare_kps3_kps4.jl\n│   ├── plot2d.jl\n│   ├── reel_out.jl\n│   ├── simulate_ii.jl\n│   └── simulate_simple.jl\n├── LICENSE\n├── Manifest-1.7.toml.default\n├── Manifest-1.8.toml.default\n├── Manifest.toml\n├── Project.toml\n├── README.md\n├── src\n│   ├── init.jl\n│   ├── KiteModels.jl\n│   ├── KPS3.jl\n│   └── KPS4.jl\n└── test\n ├── bench3.jl\n ├── bench4.jl\n ├── create_sys_image2.jl\n ├── create_sys_image.jl\n ├── plot2d.jl\n ├── plot_initial_state.jl\n ├── plot_kps3.jl\n ├── plot_kps4.jl\n ├── runtests.jl\n ├── test_for_precompile.jl\n ├── test_kps3.jl\n ├── test_kps4.jl\n ├── test_staticarrays.jl\n ├── test_steady_state.jl\n ├── test_sundials.jl\n └── update_packages.jl\n\n9 directories, 55 files","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Now leave Julia with the command exit() and then type:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"cd bin\n./create_sys_image --update","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"This will take about 6 min on a i7-10510U CPU. You should now see a new file in the bin folder:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"~/repos/test/bin$ ls -lah kps*\n-rwxrwxr-x 1 ufechner ufechner 344M apr 18 18:23 kps-image-1.7.so","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"You can launch julia such that it makes use of this system image with the commands:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"cd ..\n./bin/run_julia","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"If you now run any of the examples the time-to-first-plot (TTFP) should be less than 25s:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"julia> @time include(\"examples/simulate_simple.jl\")\nlift, drag [N]: 597.61, 129.33\nAverage number of callbacks per time step: 481.845\n 23.901076 seconds (63.42 M allocations: 12.686 GiB, 5.67% gc time, 70.62% compilation time)\n\njulia> ","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"A second run of this command needs about 5.5 s which means the startup time (load and compilation time of the package and the libraries) has been reduced to about 18.4s.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Without a system image the first time execution of the script \"simulate_simple.jl\" on the same computer is about 71 seconds while the time for the second execution is the same (5.5s). So now about 47s of time are saved after each restart.","category":"page"},{"location":"advanced/#Hints-for-Developers","page":"Advanced usage","title":"Hints for Developers","text":"","category":"section"},{"location":"advanced/#Coding-style","page":"Advanced usage","title":"Coding style","text":"","category":"section"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"add the packages TestEnv and Revise to your global environment, not to any project\navoid hard-coded numeric values like 9.81 in the code, instead define a global constant G_EARTH or read this value from a configuration file\nstick to a line length limit of 120 characters\ntry to avoid dot operators unless you have to. ","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Bad: norm1 .~ norm(segment) Good: norm1 ~ norm(segment)","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"if you need to refer to the settings you can use se() which will load the settings of the active project. To define the active project use a line like set = se(\"system_3l.yaml\") at the beginning of your program.\nuse the \\cdot operator for the dot product for improved readability\nuse a space after a comma, e.g. force_eqs[j, i]\nenclose operators like + and * in single spaces, like 0.5 * (s.pos[s.num_C] + s.pos[s.num_D]); exception: mass_tether_particle[i-1]\ntry to align the equation signs for improved readability like this:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":" tether_rhs = [force_eqs[j, i].rhs for j in 1:3]\n kite_rhs = [force_eqs[j, i+3].rhs for j in 1:3]\n f_xy = dot(tether_rhs, e_z) * e_z","category":"page"},{"location":"advanced/#Outlook","page":"Advanced usage","title":"Outlook","text":"","category":"section"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"The next steps:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"re-implement the KPS4 model using ModelingToolkit\nadd a Matlab/ Simulink wrapper similar to the Python wrapper pykitemodels","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"CurrentModule = KiteModels","category":"page"},{"location":"examples_4p/#Examples-for-using-the-four-point-kite-model","page":"Examples_4p","title":"Examples for using the four point kite model","text":"","category":"section"},{"location":"examples_4p/#Create-a-test-project","page":"Examples_4p","title":"Create a test project","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"mkdir test\ncd test\njulia --project=\".\"","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"With the last command, we told Julia to create a new project in the current directory.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Then we add the three required packages to our new project. By pressing the key \"]\" we enter the package manager mode where we can add or delete packages.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"]\nadd KiteUtils\nadd KitePodModels\nadd KiteModels\nst\n","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"The command \"st\" was not really required, but it is useful to display which versions of the packages we have in our project. Another important package manager command is the command \"up\", which updates all packages to the latest compatible versions.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Then, copy the default configuration files and examples to your new project:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"using KiteModels\ncopy_settings()\ncopy_examples()","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"The first command copies the files settings.yaml and system.yaml to the folder data. They can be customized later. The second command creates an examples folder with some examples.","category":"page"},{"location":"examples_4p/#Plotting-the-initial-state","page":"Examples_4p","title":"Plotting the initial state","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"First, an instance of the model of the kite control unit (KCU) is created which is needed by the Kite Power System model KPS3. Then we create a kps instance, passing the kcu model as parameter. We need to declare these variables as const to achieve a decent performance.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"using KiteModels\nkcu::KCU = KCU(se())\nkps = KPS4(kcu)","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Then we call the function find_steady_state which uses a non-linear solver to find the solution for a given elevation angle, reel-out speed and wind speed. ","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"find_steady_state!(kps, prn=true)","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Finding the steady state of the 4-point model is difficult and it only works when we artificially reduce the stiffness by a factor of 0.035. In the function init_sim! this factor is slowly increased to 1.0.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"To plot the result in 2D we extract the vectors of the x and z coordinates of the tether particles with a for loop:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"x = Float64[] \nz = Float64[]\nfor i in 1:length(kps.pos)\n push!(x, kps.pos[i][1])\n push!(z, kps.pos[i][3])\nend","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"And finally, we plot the position of the particles in the x-z plane. When you type using ControlPlots you will be asked if you want to install the ControlPlots package. Just press \\ and it gets installed.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"using ControlPlots\nplot(x,z, xlabel=\"x [m]\", ylabel=\"z [m]\", scatter=true)","category":"page"},{"location":"examples_4p/#Initial-State","page":"Examples_4p","title":"Initial State","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"(Image: Initial State)","category":"page"},{"location":"examples_4p/#Print-other-model-outputs","page":"Examples_4p","title":"Print other model outputs","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the vector of the positions of the particles:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> kps.pos\n11-element StaticArrays.SVector{11, StaticArrays.MVector{3, Float64}} with indices SOneTo(11):\n [0.0, 0.0, 0.0]\n [9.179237622840555, 0.0, 23.842235605018427]\n [18.04995989861643, 0.0, 47.800963572571995]\n [26.562156210544767, 0.0, 71.88939923189402]\n [34.68610302268368, 0.0, 96.11152960655927]\n [42.39897331360162, 0.0, 120.4676716318371]\n [49.681585065247006, 0.0, 144.95590371155842]\n [50.19560621291923, 0.0, 150.01396766608025]\n [51.447158096922415, 0.0, 152.22064860101747]\n [51.269841233250816, 2.823293379900761, 149.7849943282592]\n [51.269841233250816, -2.823293379900761, 149.7849943282592]\n","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the unstretched and stretched tether length and the height of the kite:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> unstretched_length(kps)\n150.0\n\njulia> tether_length(kps)\n153.28916318946136\n\njulia> calc_height(kps)\n152.22064860101747","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Because of the the stiffness_factor of 0.035 we have a longer tether-length then when using the 1 point kite model. ","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the force at the winch (groundstation, in Newton) and at each tether segment:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> winch_force(kps)\n471.70242280223385\n\njulia> spring_forces(kps)\n15-element Vector{Float64}:\n 471.6945339755092\n 471.690450982437\n 471.6880774303635\n 471.68627774821994\n 471.68477542957345\n 471.68345917403485\n 95.87508612176553\n -58.70207142208335\n -50.06490404375146\n 226.23422847228494\n 215.8389386786939\n 215.8389386786939\n 226.23422847228494\n -58.70207142208335\n 99.72953663093385","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Some of the forces are negative which means the segments are getting compressed. This is acceptable for the kite itself (not for the tether).","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the lift and drag forces of the kite (in Newton) and the lift-over-drag ratio:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> lift, drag = lift_drag(kps)\n(382.18880762331327, 117.58827293691883)\n\njulia> lift_over_drag(kps)\n3.250228939312184","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the wind speed vector at the kite:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> v_wind_kite(kps)\n3-element StaticArrays.MVector{3, Float64} with indices SOneTo(3):\n 12.542508333667467\n 0.0\n 0.0","category":"page"},{"location":"examples_4p/#Example-of-reeling-out-the-tether","page":"Examples_4p","title":"Example of reeling out the tether","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"include(\"examples/reel_out_4p.jl\")","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"(Image: Reel out 4p model)","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"In this example, we first keep the tether length constant and at 15 s start to reel out the winch with an acceleration of 0.1 m/s². At a set speed below 2.2 m/s the brake of the winch is active, therefore the \"jump\" in the v_reelout at the beginning of the reel-out phase.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"It is not a real jump, but a high acceleration compared to the acceleration afterward.","category":"page"},{"location":"","page":"Home","title":"Home","text":"CurrentModule = KiteModels","category":"page"},{"location":"#KiteModels","page":"Home","title":"KiteModels","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Documentation for the package KiteModels.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The model has the following subcomponents, implement in separate packages:","category":"page"},{"location":"","page":"Home","title":"Home","text":"AtmosphericModel from AtmosphericModels\nWinchModel from WinchModels \nKitePodModel from KitePodModels","category":"page"},{"location":"","page":"Home","title":"Home","text":"This package is part of Julia Kite Power Tools, which consist of the following packages:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: Julia Kite Power Tools)","category":"page"},{"location":"#What-to-install","page":"Home","title":"What to install","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you want to run simulations and see the results in 3D, please install the meta package KiteSimulators which contains all other packages. If you are not interested in 3D visualization or control you can just install this package. When you have installed the package KiteSimulators, use the command using KiteSimulators instead of using KiteModels when this is mentioned in the documentation.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Install Julia 1.10 or later, if you haven't already. Before installing this software it is suggested to create a new project, for example like this:","category":"page"},{"location":"","page":"Home","title":"Home","text":"mkdir test\ncd test\njulia --project=\".\"","category":"page"},{"location":"","page":"Home","title":"Home","text":"Now add KiteModels from Julia's package manager, by typing ","category":"page"},{"location":"","page":"Home","title":"Home","text":"using Pkg\npkg\"add KiteModels\"","category":"page"},{"location":"","page":"Home","title":"Home","text":"at the Julia prompt. You can run the unit tests with the command:","category":"page"},{"location":"","page":"Home","title":"Home","text":"pkg\"test KiteModels\"","category":"page"},{"location":"","page":"Home","title":"Home","text":"You can copy the examples to your project with:","category":"page"},{"location":"","page":"Home","title":"Home","text":"using KiteModels\nKiteModels.install_examples()","category":"page"},{"location":"","page":"Home","title":"Home","text":"This also adds the extra packages, needed for the examples to the project. Furthermore, it creates a folder data with some example input files. You can now run the examples with the command:","category":"page"},{"location":"","page":"Home","title":"Home","text":"include(\"examples/menu.jl\")","category":"page"},{"location":"#News","page":"Home","title":"News","text":"","category":"section"},{"location":"#August-2024","page":"Home","title":"August 2024","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"a new kite model, KPS3_3L was contributed. It uses three lines to the ground and three winches for steering a ram-air foil kite.\na new KCU model was added which assumes a linear relationship between the depower settings and the depower angle and thus is easier to configure than the original model.","category":"page"},{"location":"#July-2024","page":"Home","title":"July 2024","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"a new groundstation / winch-type is now supported, the TorqueControlledMachine. It can be configured in the section winch of the settings.yaml file. It uses a set torque as input.\na Python interface is now provided, see: pykitemodels","category":"page"},{"location":"#April-2024","page":"Home","title":"April 2024","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"added support for the native Julia DAE solver DFBDF. It is much more accurate and faster than the IDA solver that was used before.","category":"page"},{"location":"#Provides","page":"Home","title":"Provides","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The type AbstractKiteModel with the implementation KPS3, KPS4 and KPS4_3L, representing the one point, the four point kite model and the four point - three lines model, together with the high level simulation interface consisting of the functions init_sim! and next_step!. Other kite models can be added inside or outside of this package by implementing the non-generic methods required for an AbstractKiteModel.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Additional functions to provide inputs and outputs of the model on each time step. In particular the constructor SysState can be called once per time step to create a SysState struct for logging or for displaying the state in a viewer. Per time step the residual! function is called as many times as needed to find the solution at the end of the time step. The formulas are based on basic physics and aerodynamics and can be quite simple because a differential algebraic notation is used.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: Four point kite power system model)","category":"page"},{"location":"#Reference-frames-and-control-inputs","page":"Home","title":"Reference frames and control inputs","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"a positive set_torque will accelerate the reel-out, a negative set_torque counteract the pulling force of the kite. The unit is [N/m] as seen at the motor/generator axis.\nthe depower settings are dimensionless and can be between zero and one. A value equal to mathrmdepower_zero100 from the settings.yaml file means that the kite is fully powered. ","category":"page"},{"location":"","page":"Home","title":"Home","text":"A definition of the reference frames can be found here .","category":"page"},{"location":"#Further-reading","page":"Home","title":"Further reading","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The one point and four point kite models are described in detail in Dynamic Model of a Pumping Kite Power System.","category":"page"},{"location":"#See-also","page":"Home","title":"See also","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Research Fechner for the scientic background of this code\nThe application KiteViewer\nthe package KiteUtils\nthe packages WinchModels and KitePodModels and AtmosphericModels\nthe packages KiteControllers and KiteViewers","category":"page"},{"location":"","page":"Home","title":"Home","text":"Authors: Uwe Fechner (uwe.fechner.msc@gmail.com) and Bart van de Lint","category":"page"},{"location":"parameters/","page":"Parameters","title":"Parameters","text":"CurrentModule = KiteModels","category":"page"},{"location":"parameters/#Configuration","page":"Parameters","title":"Configuration","text":"","category":"section"},{"location":"parameters/","page":"Parameters","title":"Parameters","text":"To configure the parameters of the kite models, edit the file data/settings.yaml, or create a copy under a different name and change the name of the active configuration in the file data/system.yaml.","category":"page"},{"location":"parameters/#Parameters","page":"Parameters","title":"Parameters","text":"","category":"section"},{"location":"parameters/","page":"Parameters","title":"Parameters","text":"The following parameters are used by this package:","category":"page"},{"location":"parameters/","page":"Parameters","title":"Parameters","text":"system:\n sample_freq: 20 # sample frequency in Hz\n\ninitial:\n l_tether: 150.0 # initial tether length [m]\n elevation: 70.7 # initial elevation angle [deg]\n v_reel_out: 0.0 # initial reel out speed [m/s]\n depower: 25.0 # initial depower settings [%]\n\nsolver:\n abs_tol: 0.0006 # absolute tolerance of the DAE solver [m, m/s]\n rel_tol: 0.001 # relative tolerance of the DAE solver [-]\n linear_solver: \"GMRES\" # can be GMRES or Dense\n max_order: 4 # maximal order, usually between 3 and 5\n max_iter: 200 # max number of iterations of the steady-state-solver\n\nsteering:\n c0: 0.0 # steering offset -0.0032 [-]\n c_s: 2.59 # steering coefficient one point model\n c2_cor: 0.93 # correction factor one point model\n k_ds: 1.5 # influence of the depower angle on the steering sensitivity\n\ndepower:\n alpha_d_max: 31.0 # max depower angle [deg]\n \nkite:\n model: \"data/kite.obj\" # 3D model of the kite\n mass: 6.2 # kite mass incl. sensor unit [kg]\n area: 10.18 # projected kite area [m²]\n rel_side_area: 30.6 # relative side area [%]\n height: 2.23 # height of the kite [m]\n alpha_cl: [-180.0, -160.0, -90.0, -20.0, -10.0, -5.0, 0.0, 20.0, 40.0, 90.0, 160.0, 180.0]\n cl_list: [ 0.0, 0.5, 0.0, 0.08, 0.125, 0.15, 0.2, 1.0, 1.0, 0.0, -0.5, 0.0]\n alpha_cd: [-180.0, -170.0, -140.0, -90.0, -20.0, 0.0, 20.0, 90.0, 140.0, 170.0, 180.0]\n cd_list: [ 0.5, 0.5, 0.5, 1.0, 0.2, 0.1, 0.2, 1.0, 0.5, 0.5, 0.5]\n \nkps4:\n width: 5.77 # width of the kite [m]\n alpha_zero: 4.0 # should be 5 [degrees]\n alpha_ztip: 10.0 # [degrees]\n m_k: 0.2 # relative nose distance; increasing m_k increases C2 of the turn-rate law\n rel_nose_mass: 0.47 # relative nose mass\n rel_top_mass: 0.4 # mass of the top particle relative to the sum of top and side particles\n\nbridle:\n d_line: 2.5 # bridle line diameter [mm]\n l_bridle: 33.4 # sum of the lengths of the bridle lines [m]\n h_bridle: 4.9 # height of bridle [m]\n\nkcu:\n kcu_mass: 8.4 # mass of the kite control unit [kg]\n\ntether:\n d_tether: 4 # tether diameter [mm]\n cd_tether: 0.958 # drag coefficient of the tether\n damping: 473.0 # unit damping coefficient [Ns]\n c_spring: 614600.0 # unit spring constant coefficient [N]\n rho_tether: 724.0 # density of Dyneema [kg/m³]\n\nenvironment:\n v_wind: 9.51 # wind speed at reference height [m/s]\n h_ref: 6.0 # reference height for the wind speed [m]\n\n rho_0: 1.225 # air density at the ground or zero [kg/m³]\n alpha: 0.08163 # exponent of the wind profile law\n z0: 0.0002 # surface roughness [m]\n profile_law: 6 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG","category":"page"},{"location":"types/#Exported-Types","page":"Types","title":"Exported Types","text":"","category":"section"},{"location":"types/","page":"Types","title":"Types","text":"CurrentModule = KiteModels","category":"page"},{"location":"types/#Basic-types","page":"Types","title":"Basic types","text":"","category":"section"},{"location":"types/","page":"Types","title":"Types","text":"SimFloat\nKVec3\nSVec3\nAbstractKiteModel\nAKM","category":"page"},{"location":"types/#KiteModels.SimFloat","page":"Types","title":"KiteModels.SimFloat","text":"const SimFloat = Float64\n\nThis type is used for all real variables, used in the Simulation. Possible alternatives: Float32, Double64, Dual Other types than Float64 or Float32 do require support of Julia types by the solver. \n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.KVec3","page":"Types","title":"KiteModels.KVec3","text":"const KVec3 = MVector{3, SimFloat}\n\nBasic 3-dimensional vector, stack allocated, mutable.\n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.SVec3","page":"Types","title":"KiteModels.SVec3","text":"const SVec3 = SVector{3, SimFloat}\n\nBasic 3-dimensional vector, stack allocated, immutable.\n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.AbstractKiteModel","page":"Types","title":"KiteModels.AbstractKiteModel","text":"abstract type AbstractKiteModel\n\nAll kite models must inherit from this type. All methods that are defined on this type must work with all kite models. All exported methods must work on this type. \n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.AKM","page":"Types","title":"KiteModels.AKM","text":"const AKM = AbstractKiteModel\n\nShort alias for the AbstractKiteModel. \n\n\n\n\n\n","category":"type"},{"location":"types/#Struct-KPS3-and-KPS4-and-KPS4_3L","page":"Types","title":"Struct KPS3 and KPS4 and KPS4_3L","text":"","category":"section"},{"location":"types/","page":"Types","title":"Types","text":"KPS3\nKPS4\nKPS4_3L","category":"page"},{"location":"types/#KiteModels.KPS3","page":"Types","title":"KiteModels.KPS3","text":"mutable struct KPS3{S, T, P} <: AbstractKiteModel\n\nState of the kite power system. Parameters:\n\nS: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.\nT: Vector type, e.g. MVector{3, SimFloat}\nP: number of points of the system, segments+1\n\nNormally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.\n\nset::Settings: Reference to the settings struct\nkcu::KCU: Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels\nam::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()\nwm::Union{Nothing, AbstractWinchModel}: Reference to winch model as implemented in the package WinchModels Default: nothing\niter::Int64: Iterations, number of calls to the function residual! Default: 0\ncalc_cl::Dierckx.Spline1D: Function for calculation the lift coefficent, using a spline based on the provided value pairs.\ncalc_cd::Dierckx.Spline1D: Function for calculation the drag coefficent, using a spline based on the provided value pairs.\nv_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)\nv_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)\nv_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)\nv_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)\nv_app_perp::Any: vector, perpendicular to vapparent; output of calcdrag Default: zeros(S, 3)\ndrag_force::Any: drag force of kite and bridle; output of calcaeroforces Default: zeros(S, 3)\nlift_force::Any: lift force of the kite; output of calcaeroforces Default: zeros(S, 3)\nsteering_force::Any: steering force acting on the kite; output of calcaeroforces Default: zeros(S, 3)\nlast_force::Any: Default: zeros(S, 3)\nspring_force::Any: spring force of the current tether segment, output of calc_res Default: zeros(S, 3)\ntotal_forces::Any: Default: zeros(S, 3)\nforce::Any: sum of spring and drag forces acting on the current segment, output of calc_res Default: zeros(S, 3)\nunit_vector::Any: unit vector in the direction of the current tether segment, output of calc_res Default: zeros(S, 3)\nav_vel::Any: average velocity of the current tether segment, output of calc_res Default: zeros(S, 3)\nkite_y::Any: y-vector of the kite fixed referense frame, output of calcaeroforces Default: zeros(S, 3)\nsegment::Any: vector representing one tether segment (p1-p2) Default: zeros(S, 3)\nlast_tether_drag::Any: vector of the drag force of the last calculated tether segment Default: zeros(S, 3)\nvec_z::Any: z vector of the kite reference frame Default: zeros(S, 3)\nres1::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: part one of the residual, difference between pos' and vel, non-flat, mainly for unit testing Default: zeros(SVector{P, KVec3})\nres2::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: part two of the residual, difference between vel' and acc, non-flat, mainly for unit testing Default: zeros(SVector{P, KVec3})\npos::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the positions of the particles Default: zeros(SVector{P, KVec3})\nvel_kite::Any: velocity vector of the kite Default: zeros(S, 3)\nseg_area::Any: area of one tether segment [m²] Default: zero(S)\nbridle_area::Any: total actual bridle area [m²] Default: zero(S)\nc_spring::Any: spring constant, depending on the length of the tether segment Default: zero(S)\nsegment_length::Any: unstressed segment length [m] Default: 0.0\ndamping::Any: damping factor, depending on the length of the tether segment Default: zero(S)\nlast_v_app_norm_tether::Any: last norm of the apparent wind speed at a tether segment [m/s] Default: zero(S)\nparam_cl::Any: lift coefficient of the kite, depending on the angle of attack Default: 0.2\nparam_cd::Any: drag coefficient of the kite, depending on the angle of attack Default: 1.0\ncor_steering::Any: correction term for the steering, in paper named i_(s,c), Eq. 30 Default: zero(S)\npsi::Any: azimuth angle in radian; inital value is zero Default: zero(S)\nbeta::Any: elevation angle in radian; initial value about 70 degrees Default: deg2rad((se()).elevation)\nalpha_depower::Any: depower angle [deg] Default: 0.0\nt_0::Any: relative start time of the current time interval Default: 0.0\nv_reel_out::Any: reel out speed of the winch [m/s] Default: 0.0\nlast_v_reel_out::Any: reel out speed during the last time step Default: 0.0\nl_tether::Any: unstretched tether length Default: 0.0\nrho::Any: air density at the height of the kite Default: 0.0\ndepower::Any: actual relative depower setting, must be between 0 .. 1.0 Default: 0.0\nsteering::Any: actual relative steering setting, must be between -1.0 .. 1.0 Default: 0.0\nstiffness_factor::Any: factor for the tether stiffness, used to find the steady state with a low stiffness first Default: 1.0\ninitial_masses::StaticArraysCore.MVector{P, S} where {S, P}: initial masses of the point masses Default: ones(P)\nmasses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: ones(P)\nforces::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the forces, acting on the particles Default: zeros(SVector{P, KVec3})\nsync_speed::Union{Nothing, S} where S: synchronous speed of the motor/ generator Default: 0.0\nset_torque::Union{Nothing, S} where S: set_torque of the motor/generator Default: nothing\n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.KPS4","page":"Types","title":"KiteModels.KPS4","text":"mutable struct KPS4{S, T, P, Q, SP} <: AbstractKiteModel\n\nState of the kite power system, using a 4 point kite model. Parameters:\n\nS: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.\nT: Vector type, e.g. MVector{3, SimFloat}\nP: number of points of the system, segments+1\nQ: number of springs in the system, P-1\nSP: struct type, describing a spring\n\nNormally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.\n\nset::Settings: Reference to the settings struct\nkcu::KCU: Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels\nam::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()\nwm::AbstractWinchModel: Reference to winch model as implemented in the package WinchModels\niter::Int64: Iterations, number of calls to the function residual! Default: 0\ncalc_cl::Dierckx.Spline1D: Function for calculation the lift coefficent, using a spline based on the provided value pairs.\ncalc_cd::Dierckx.Spline1D: Function for calculation the drag coefficent, using a spline based on the provided value pairs.\nv_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)\nv_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)\nv_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)\nv_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)\nbridle_factor::Any: bridlefactor = set.lbridle/bridle_length(set) Default: 1.0\nside_cl::Any: side lift coefficient, the difference of the left and right lift coeficients Default: 0.0\ndrag_force::Any: drag force of kite and bridle; output of calcaeroforces! Default: zeros(S, 3)\nside_force::Any: side_force acting on the kite Default: zeros(S, 3)\nks::Any: max_steering angle in radian Default: 0.0\nlift_force::Any: lift force of the kite; output of calcaeroforces! Default: zeros(S, 3)\nspring_force::Any: spring force of the current tether segment, output of calcparticleforces! Default: zeros(S, 3)\nlast_force::Any: last winch force Default: zeros(S, 3)\nres1::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the residual one (pos,vel) for debugging and unit tests Default: zeros(SVector{P, KVec3})\nres2::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the residual two (vel,acc) for debugging and unit tests Default: zeros(SVector{P, KVec3})\npos::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the actual positions as output for the user Default: zeros(SVector{P, KVec3})\nvel_kite::Any: velocity vector of the kite Default: zeros(S, 3)\nsegment_length::Any: unstressed segment length [m] Default: 0.0\nparam_cl::Any: lift coefficient of the kite, depending on the angle of attack Default: 0.2\nparam_cd::Any: drag coefficient of the kite, depending on the angle of attack Default: 1.0\npsi::Any: azimuth angle in radian; inital value is zero Default: zero(S)\nalpha_depower::Any: depower angle [deg] Default: 0.0\nalpha_2::Any: aoa at paricle B Default: 0.0\nalpha_2b::Any: aoa at paricle B, corrected formula Default: 0.0\nalpha_3::Any: aoa at paricle C Default: 0.0\nalpha_3b::Any: Default: 0.0\nalpha_4::Any: aoa at paricle D Default: 0.0\nalpha_4b::Any: Default: 0.0\nt_0::Any: relative start time of the current time interval Default: 0.0\nv_reel_out::Any: reel out speed of the winch Default: 0.0\nlast_v_reel_out::Any: reel out speed at the last time step Default: 0.0\nl_tether::Any: unstretched tether length Default: 0.0\nrho::Any: air density at the height of the kite Default: 0.0\ndepower::Any: actual relative depower setting, must be between 0 .. 1.0 Default: 0.0\nsteering::Any: actual relative steering setting, must be between -1.0 .. 1.0 Default: 0.0\nstiffness_factor::Any: multiplier for the stiffniss of tether and bridle Default: 1.0\ninitial_masses::StaticArraysCore.MVector{P, S} where {S, P}: initial masses of the point masses Default: ones(P)\nmasses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: zeros(P)\nsprings::StaticArraysCore.MVector: vector of the springs, defined as struct Default: zeros(SP, Q)\nforces::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the forces, acting on the particles Default: zeros(SVector{P, KVec3})\nsync_speed::Union{Nothing, S} where S: synchronous speed of the motor/ generator Default: 0.0\nset_torque::Union{Nothing, S} where S: set_torque of the motor/generator Default: nothing\nx::Any: x vector of kite reference frame Default: zeros(S, 3)\ny::Any: y vector of kite reference frame Default: zeros(S, 3)\nz::Any: z vector of kite reference frame Default: zeros(S, 3)\n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.KPS4_3L","page":"Types","title":"KiteModels.KPS4_3L","text":"mutable struct KPS4_3L{S, T, P, Q, SP} <: AbstractKiteModel\n\nState of the kite power system, using a 3 point kite model and three steering lines to the ground. Parameters:\n\nS: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.\nT: Vector type, e.g. MVector{3, SimFloat}\nP: number of points of the system, segments+3\nQ: number of springs in the system, P-1\nSP: struct type, describing a spring\n\nNormally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.\n\nset::Settings: Reference to the settings struct\nset_hash::UInt64: Reference to the settings hash Default: 0\nlast_init_elevation::Float64: The last initial elevation Default: 0.0\nlast_init_tether_length::Float64: The last initial tether length Default: 0.0\nlast_set_hash::UInt64: Reference to the last settings hash Default: 0\nam::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()\ncalc_cl::Any: Function for calculation the lift coefficent, using a spline based on the provided value pairs. Default: Spline1D((se()).alphacl, (se()).cllist)\ncalc_cd::Any: Function for calculation the drag coefficent, using a spline based on the provided value pairs. Default: Spline1D((se()).alphacd, (se()).cdlist)\nmotors::StaticArraysCore.SVector{3, AbstractWinchModel}: Reference to the motor models as implemented in the package WinchModels. index 1: middle motor, index 2: left motor, index 3: right motor\niter::Int64: Iterations, number of calls to the function residual! Default: 0\nv_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)\nv_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)\nv_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)\nv_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)\nwinch_forces::StaticArraysCore.SVector{3}: last winch force Default: [zeros(S, 3) for _ = 1:3]\nres1::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the residual one (pos,vel) for debugging and unit tests Default: zeros(SVector{P, T})\nres2::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the residual two (vel,acc) for debugging and unit tests Default: zeros(SVector{P, T})\npos::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the actual positions as output for the user Default: zeros(SVector{P, T})\nvel::StaticArraysCore.SVector{P, T} where {T, P}: Default: zeros(SVector{P, T})\nveld::StaticArraysCore.SVector{P, T} where {T, P}: Default: zeros(SVector{P, T})\nvel_kite::Any: velocity vector of the kite Default: zeros(S, 3)\nsegment_lengths::Any: unstressed segment lengths of the three tethers [m] Default: zeros(S, 3)\npsi::Any: azimuth angle in radian; inital value is zero Default: zero(S)\nt_0::Any: relative start time of the current time interval Default: 0.0\nreel_out_speeds::Any: reel out speed of the winch Default: zeros(S, 3)\ntether_lengths::Any: unstretched tether length Default: zeros(S, 3)\nsteering_pos::StaticArraysCore.MVector{2}: lengths of the connections of the steering tethers to the kite Default: zeros(S, 2)\nrho::Any: air density at the height of the kite Default: 0.0\nstiffness_factor::Any: multiplier for the stiffniss of tether and bridle Default: 1.0\nmasses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: zeros(P)\nsprings::StaticArraysCore.MVector: vector of the springs, defined as struct Default: zeros(SP, Q)\nforces::StaticArraysCore.SVector{P, T} where {T, P}: vector of the forces, acting on the particles Default: zeros(SVector{P, T})\nset_values::StaticArraysCore.MVector{3, Float64}: synchronous speed or torque of the motor/ generator Default: zeros(KVec3)\ntorque_control::Bool: whether or not to use torque control instead of speed control Default: false\ne_x::Any: x vector of kite reference frame Default: zeros(S, 3)\ne_y::Any: y vector of kite reference frame Default: zeros(S, 3)\ne_z::Any: z vector of kite reference frame Default: zeros(S, 3)\nnum_E::Int64: Point number of E Default: 0\nnum_C::Int64: Point number of C Default: 0\nnum_D::Int64: Point number of D Default: 0\nnum_A::Int64: Point number of A Default: 0\nα_l::Float64: Angle of right tip Default: 0.0\nα_r::Float64: Angle of left tip Default: 0.0\nL_C::Any: Lift of point C Default: zeros(S, 3)\nL_D::Any: Lift of point D Default: zeros(S, 3)\nD_C::Any: Drag of point C Default: zeros(S, 3)\nD_D::Any: Drag of point D Default: zeros(S, 3)\nsteady_sol::Union{Nothing, SciMLBase.NonlinearSolution}: Solution of the steady state problem Default: nothing\nsimple_sys::Union{Nothing, ModelingToolkit.ODESystem}: Simplified system of the mtk model Default: nothing\nset_values_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing\nv_wind_gnd_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing\nstiffness_factor_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing\nv_wind_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing\nprob::Union{Nothing, SciMLBase.ODEProblem}: Default: nothing\nget_pos::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_steering_pos::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_line_acc::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_kite_vel::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_winch_forces::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_tether_lengths::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_tether_speeds::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_L_C::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_L_D::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_D_C::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_D_D::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\n\n\n\n\n\n","category":"type"},{"location":"types/","page":"Types","title":"Types","text":"These structs store the state of the one point model and four point model. Only in unit tests it is allowed to access the members directly, otherwise use the input and output functions. The model KPS4_3L is not yet implemented, it is just a copy of KPS4.","category":"page"}] +[{"location":"functions/","page":"Functions","title":"Functions","text":"CurrentModule = KiteModels","category":"page"},{"location":"functions/#Introduction","page":"Functions","title":"Introduction","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"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:","category":"page"},{"location":"functions/","page":"Functions","title":"Functions","text":"using KiteSimulators\nconst s = KPS3(KCU(se()))","category":"page"},{"location":"functions/","page":"Functions","title":"Functions","text":"Or, if you want to use the 4 point kite model:","category":"page"},{"location":"functions/","page":"Functions","title":"Functions","text":"using KiteSimulators\nconst s = KPS4(KCU(se()))","category":"page"},{"location":"functions/","page":"Functions","title":"Functions","text":"Functions with an \"!\" as last character of the function name modify one of more of their parameters, in this context mostly the variable s.","category":"page"},{"location":"functions/#Input-functions","page":"Functions","title":"Input functions","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"set_depower_steering!\nset_v_wind_ground!","category":"page"},{"location":"functions/#KiteModels.set_depower_steering!","page":"Functions","title":"KiteModels.set_depower_steering!","text":"set_depower_steering!(s::AKM, depower, steering)\n\nSetter for the depower and steering model inputs. \n\nParameters:\n\ndepower: Relative depower, must be between 0 .. 1.0\nsteering: Relative steering, must be between -1.0 .. 1.0. \n\nThis function sets the variables s.depower, s.steering and s.alpha_depower. \n\nIt takes the depower offset c0 and the dependency of the steering sensitivity from the depower settings into account.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.set_v_wind_ground!","page":"Functions","title":"KiteModels.set_v_wind_ground!","text":"set_v_wind_ground!(s::AKM, height, v_wind_gnd=s.set.v_wind, wind_dir=0.0)\n\nSet 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.\n\n\n\n\n\n","category":"function"},{"location":"functions/#Output-functions","page":"Functions","title":"Output functions","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"unstretched_length\ntether_length\npos_kite\ncalc_height\ncalc_elevation\ncalc_azimuth\ncalc_heading\ncalc_course\ncl_cd\nwinch_force\nspring_forces\nlift_drag\nlift_over_drag\nv_wind_kite\nkite_ref_frame\norient_euler\nSysState","category":"page"},{"location":"functions/#KiteModels.unstretched_length","page":"Functions","title":"KiteModels.unstretched_length","text":"unstretched_length(s::KPS4_3L)\n\nGetter for the unstretched tether reel-out lenght (at zero force).\n\n\n\n\n\nunstretched_length(s::AKM)\n\nGetter for the unstretched tether reel-out lenght (at zero force).\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.tether_length","page":"Functions","title":"KiteModels.tether_length","text":"tether_length(s::KPS4_3L)\n\nCalculate and return the real, stretched tether lenght.\n\n\n\n\n\ntether_length(s::AKM)\n\nCalculate and return the real, stretched tether lenght.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.pos_kite","page":"Functions","title":"KiteModels.pos_kite","text":"pos_kite(s::KPS4)\n\nReturn the position of the kite (top particle).\n\n\n\n\n\npos_kite(s::KPS4_3L)\n\nReturn the position of the kite (top particle).\n\n\n\n\n\npos_kite(s::KPS3)\n\nReturn the position of the kite (top particle).\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_height","page":"Functions","title":"KiteModels.calc_height","text":"calc_height(s::KPS4)\n\nDetermine the height of the topmost kite particle above ground.\n\n\n\n\n\ncalc_height(s::KPS4_3L)\n\nDetermine the height of the topmost kite particle above ground.\n\n\n\n\n\ncalc_height(s::KPS3)\n\nDetermine the height of the kite particle above ground.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.calc_elevation","page":"Functions","title":"KiteUtils.calc_elevation","text":"calc_elevation(s::AKM)\n\nDetermine the elevation angle of the kite in radian.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.calc_azimuth","page":"Functions","title":"KiteUtils.calc_azimuth","text":"calc_azimuth(s::AKM)\n\nDetermine the azimuth angle of the kite in radian.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.calc_heading","page":"Functions","title":"KiteUtils.calc_heading","text":"calc_heading(s::AKM)\n\nDetermine the heading angle of the kite in radian.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.calc_course","page":"Functions","title":"KiteUtils.calc_course","text":"calc_course(s::AKM)\n\nDetermine the course angle of the kite in radian. Undefined if the velocity of the kite is near zero.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.cl_cd","page":"Functions","title":"KiteModels.cl_cd","text":"cl_cd(s::KPS4)\n\nCalculate the lift and drag coefficients of the kite, based on the current angles of attack.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.winch_force","page":"Functions","title":"KiteModels.winch_force","text":"winch_force(s::KPS4)\n\nReturn the absolute value of the force at the winch as calculated during the last timestep. \n\n\n\n\n\nwinch_force(s::KPS4_3L)\n\nReturn the absolute value of the force at the winch as calculated during the last timestep. \n\n\n\n\n\nwinch_force(s::KPS3)\n\nReturn the absolute value of the force at the winch as calculated during the last timestep. \n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.spring_forces","page":"Functions","title":"KiteModels.spring_forces","text":"spring_forces(s::AKM)\n\nReturn an array of the scalar spring forces of all tether segements.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.lift_drag","page":"Functions","title":"KiteModels.lift_drag","text":"lift_drag(s::AKM)\n\nReturn a tuple of the scalar lift and drag forces. \n\nExample: \n\nlift, drag = lift_drag(s)\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.lift_over_drag","page":"Functions","title":"KiteModels.lift_over_drag","text":"lift_over_drag(s::AKM)\n\nReturn the lift-over-drag ratio.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.v_wind_kite","page":"Functions","title":"KiteModels.v_wind_kite","text":"v_wind_kite(s::AKM)\n\nReturn the vector of the wind speed at the height of the kite.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.kite_ref_frame","page":"Functions","title":"KiteModels.kite_ref_frame","text":"kite_ref_frame(s::KPS4)\n\nReturns a tuple of the x, y, and z vectors of the kite reference frame.\n\n\n\n\n\nkite_ref_frame(s::KPS4_3L)\n\nReturns a tuple of the x, y, and z vectors of the kite reference frame.\n\n\n\n\n\nkite_ref_frame(s::KPS3)\n\nReturns a tuple of the x, y, and z vectors of the kite reference frame.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.orient_euler","page":"Functions","title":"KiteModels.orient_euler","text":"orient_euler(s::AKM)\n\nCalculate and return the orientation of the kite in euler angles (roll, pitch, yaw) as SVector. \n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteUtils.SysState","page":"Functions","title":"KiteUtils.SysState","text":"SysState(s::AKM, zoom=1.0)\n\nConstructor for creating a SysState object from a kite model (KPS3 or KPS4). The SysState object can be used either for logging or for displaying the system state in a viewer. Optionally the position arrays can be zoomed according to the requirements of the viewer.\n\n\n\n\n\n","category":"type"},{"location":"functions/#High-level-simulation-interface","page":"Functions","title":"High level simulation interface","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"init_sim!\nnext_step!","category":"page"},{"location":"functions/#KiteModels.init_sim!","page":"Functions","title":"KiteModels.init_sim!","text":"init_sim!(s; t_end=1.0, stiffness_factor=1.0, prn=false)\n\nInitialises the integrator of the model.\n\nParameters:\n\ns: an instance of an abstract kite model\nt_end: end time of the simulation; normally not needed\nstiffness_factor: factor applied to the tether stiffness during initialisation\nprn: if set to true, print the detailed solver results\nsteadystatehistory: an instance of SteadyStateHistory containing old pairs of AKM objects and integrators\n\nReturns: An instance of a DAE integrator.\n\n\n\n\n\ninit_sim!(s; t_end=1.0, stiffness_factor=0.035, delta=0.01, prn=false)\n\nInitialises the integrator of the model.\n\nParameters:\n\ns: an instance of an abstract kite model\nt_end: end time of the simulation; normally not needed\nstiffness_factor: factor applied to the tether stiffness during initialisation\ndelta: initial stretch of the tether during the steady state calculation\nprn: if set to true, print the detailed solver results\nsteadystatehistory: an instance of SteadyStateHistory containing old pairs of AKM objects and integrators\n\nReturns: An instance of a DAE integrator.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.next_step!","page":"Functions","title":"KiteModels.next_step!","text":"next_step!(s::AKM, integrator; set_speed = nothing, set_torque=nothing, v_wind_gnd=s.set.v_wind, wind_dir=0.0, \n dt=1/s.set.sample_freq)\n\nCalculates the next simulation step.\n\nParameters:\n\ns: an instance of an abstract kite model\nintegrator: an integrator instance as returned by the function init_sim!\nset_speed: set value of reel out speed in m/s or nothing\nset_torque: set value of the torque in Nm or nothing\nv_wind_gnd: wind speed at reference height in m/s\nupwind_dir: upwind direction in radians, the direction the wind is coming from. Zero is at north; clockwise positive. Default: -pi/2, wind from west.\ndt: time step in seconds\n\nEither a value for set_speed or for set_torque required.\n\nReturns: The end time of the time step in seconds.\n\n\n\n\n\n","category":"function"},{"location":"functions/#Low-level-simulation-interface","page":"Functions","title":"Low level simulation interface","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"clear!\nfind_steady_state!\nresidual!","category":"page"},{"location":"functions/#KiteModels.clear!","page":"Functions","title":"KiteModels.clear!","text":"clear!(s::KPS4)\n\nInitialize the kite power model.\n\n\n\n\n\nclear!(s::KPS4_3L)\n\nInitialize the kite power model.\n\n\n\n\n\nclear!(s::KPS3)\n\nInitialize the kite power model.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.find_steady_state!","page":"Functions","title":"KiteModels.find_steady_state!","text":"find_steady_state!(s::KPS4; prn=false, delta = 0.01, stiffness_factor=0.035)\n\nFind an initial equilibrium, based on the inital parameters l_tether, elevation and v_reel_out.\n\n\n\n\n\nfind_steady_state!(s::KPS3, prn=false, delta = 0.0, stiffness_factor=0.035)\n\nFind an initial equilibrium, based on the inital parameters l_tether, elevation and v_reel_out.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.residual!","page":"Functions","title":"KiteModels.residual!","text":"residual!(res, yd, y::MVector{S, SimFloat}, s::KPS4, time) where S\n\nN-point tether model, four points for the kite on top:\nInputs:\nState vector y = pos1, pos2, ... , posn, vel1, vel2, . .., veln, length, v_reel_out\nDerivative yd = posd1, posd2, ..., posdn, veld1, veld2, ..., veldn, lengthd, v_reel_outd\nOutput:\nResidual res = res1, res2 = vel1-posd1, ..., veld1-acc1, ..., \n\nAdditional parameters:\ns: Struct with work variables, type KPS4\nS: The dimension of the state vector\n\nThe number of the point masses of the model N = S/6, the state of each point is represented by two 3 element vectors.\n\n\n\n\n\nresidual!(res, yd, y::MVector{S, SimFloat}, s::KPS3, time) where S\n\nN-point tether model, one point kite at the top:\nInputs:\nState vector y = pos1, pos2, ..., posn, vel1, vel2, ..., veln\nDerivative yd = vel1, vel2, ..., veln, acc1, acc2, ..., accn\nOutput:\nResidual res = res1, res2 = pos1, ..., vel1, ...\n\nAdditional parameters:\ns: Struct with work variables, type KPS3\nS: The dimension of the state vector\n\nThe number of the point masses of the model N = S/6, the state of each point is represented by two 3 element vectors.\n\n\n\n\n\n","category":"function"},{"location":"functions/#Helper-functions","page":"Functions","title":"Helper functions","text":"","category":"section"},{"location":"functions/","page":"Functions","title":"Functions","text":"copy_examples\ncopy_bin\ncalc_drag\ncalc_set_cl_cd!\ncalc_aero_forces!\ncalc_particle_forces!\ninner_loop!\nloop!","category":"page"},{"location":"functions/#KiteModels.copy_examples","page":"Functions","title":"KiteModels.copy_examples","text":"copy_examples()\n\nCopy all example scripts to the folder \"examples\" (it will be created if it doesn't exist).\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.copy_bin","page":"Functions","title":"KiteModels.copy_bin","text":"copy_bin()\n\nCopy the scripts createsysimage and run_julia to the folder \"bin\" (it will be created if it doesn't exist).\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_drag","page":"Functions","title":"KiteModels.calc_drag","text":"calc_drag(s::KPS3, v_segment, unit_vector, rho, last_tether_drag, v_app_perp)\n\nCalculate the drag of one tether segment, result stored in parameter last_tether_drag. Return the norm of the apparent wind velocity.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_set_cl_cd!","page":"Functions","title":"KiteModels.calc_set_cl_cd!","text":"calc_set_cl_cd!(s::KPS3, vec_c, v_app)\n\nCalculate 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. \n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_aero_forces!","page":"Functions","title":"KiteModels.calc_aero_forces!","text":"calc_aero_forces!(s::KPS4, pos, vel, rho, alpha_depower, rel_steering)\n\nCalculates the aerodynamic forces acting on the kite particles.\n\nParameters:\n\npos: vector of the particle positions\nvel: vector of the particle velocities\nrho: air density [kg/m^3]\nrel_depower: value between 0.0 and 1.0\nalpha_depower: depower angle [degrees]\nrel_steering: value between -1.0 and +1.0\n\nUpdates the vector s.forces of the first parameter.\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.calc_particle_forces!","page":"Functions","title":"KiteModels.calc_particle_forces!","text":"calc_particle_forces!(s::KPS4, pos1, pos2, vel1, vel2, spring, segments, d_tether, rho, i)\n\nCalculate 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. \n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.inner_loop!","page":"Functions","title":"KiteModels.inner_loop!","text":"inner_loop!(s::KPS4, pos, vel, v_wind_gnd, segments, d_tether)\n\nCalculate the forces, acting on all particles.\n\nOutput:\n\ns.forces\ns.v_wind_tether\n\n\n\n\n\n","category":"function"},{"location":"functions/#KiteModels.loop!","page":"Functions","title":"KiteModels.loop!","text":"loop!(s::KPS4, pos, vel, posd, veld)\n\nCalculate the vectors s.res1 and calculate s.res2 using loops that iterate over all tether segments. \n\n\n\n\n\n","category":"function"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"CurrentModule = KiteModels","category":"page"},{"location":"quickstart/#Quickstart","page":"Quickstart","title":"Quickstart","text":"","category":"section"},{"location":"quickstart/#Installation-of-Julia","page":"Quickstart","title":"Installation of Julia","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"For a quick test of this program, it is NOT needed to install VSCode, git or bash. Just installing Julia is sufficient, and that can be done in a few minutes. ","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      \n Windows","category":"page"},{"location":"quickstart/#Windows","page":"Quickstart","title":"Windows","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Please download and install Julia using juliaup. Launch the Command Prompt app and type:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"winget install julia -s msstore\njuliaup add 1.10\njuliaup update","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"If that doesn't work, download https://install.julialang.org/Julia.appinstaller and double-click on the downloaded file to install it.","category":"page"},{"location":"quickstart/#Optional","page":"Quickstart","title":"Optional","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"It is suggested to install Windows Terminal . Copy and paste works better, unicode works much better and you can use it with bash or Command Prompt, whatever you prefer. It is suggested to set one of these two as default using the Settings menu of Windows Terminal.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      ","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      \n Linux","category":"page"},{"location":"quickstart/#Linux","page":"Quickstart","title":"Linux","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Copy and past the following line to install julia:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"curl -fsSL https://install.julialang.org | sh","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Restart your terminal, and then execute:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"juliaup add 1.10\njuliaup update","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"It is suggested to add the following line to your .bashrc file:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"alias jl='./bin/run_julia'","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"This makes it possible to run Julia with the shortcut jl later.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      ","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      \n Mac","category":"page"},{"location":"quickstart/#Mac","page":"Quickstart","title":"Mac","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Please download and install juliaup as explained at https://github.com/JuliaLang/juliaup .","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Restart your terminal, and then execute:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"juliaup add 1.10\njuliaup update","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"
      ","category":"page"},{"location":"quickstart/#Create-a-test-project","page":"Quickstart","title":"Create a test project","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Launch a command prompt and create a folder with the name \"test\":","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"mkdir test\ncd test\njulia --project=\".\"","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"With the last command, we told Julia to create a new project in the current directory.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Then we add the three required packages to our new project. By pressing the key \"]\" we enter the package manager mode where we can add or delete packages.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"]\nadd KiteUtils\nadd KitePodModels\nadd KiteModels\nadd ControlPlots\nst\n","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"The command \"st\" was not really required, but it is useful to display which versions of the packages we have in our project. Another important package manager command is the command \"up\", which updates all packages to the latest compatible versions.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Then, copy the default configuration files and examples to your new project:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"using KiteModels\ncopy_settings()\ncopy_examples()","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"The first command copies the files settings.yaml and system.yaml to the folder data. They can be customized later. The second command creates an examples folder with some examples.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Your folder structure should now look like this:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"shell> tree\n.\n├── data\n│   ├── kite.obj\n│   ├── settings.yaml\n│   └── system.yaml\n├── examples\n│   ├── bench.jl\n│   ├── compare_kps3_kps4.jl\n│   ├── menu.jl\n│   ├── reel_out_1p.jl\n│   ├── reel_out_4p.jl\n│   ├── reel_out_4p_torque_control.jl\n│   ├── simulate_simple.jl\n│   └── simulate_steering.jl\n├── Manifest.toml\n└── Project.toml\n\n2 directories, 7 files","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"You can access the operating system command line by typing the character \";\", you then get a \"shell\" prompt and can enter operating system commands. To leave shell mode, type \\. On windows you need to type tree /f instead of tree to see the files.","category":"page"},{"location":"quickstart/#Executing-the-first-example","page":"Quickstart","title":"Executing the first example","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"From the Julia prompt you can use the command \"include\" to execute a script:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"include(\"examples/simulate_simple.jl\")","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"On Windows you need to type \"\\\\\" instead of \"/\":","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"include(\"examples\\\\simulate_simple.jl\")","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"You will see the 4-point kite fly for 30s. If you want to change the settings of the simulation, open the file simulate_simple.jlin your favorite text editor, modify the settings at the beginning of the file and execute the include command again. You can use the key for autocompletion, for exampleinclude(exTABcompletes toinclude(examples` which can save a lot of typing. If you type again you get a list of files to choose from.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Try out changing the following default settings:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"dt = 0.05\nSTEPS = 600\nPLOT = true\nFRONT_VIEW = false\nZOOM = true\nPRINT = false\nSTATISTIC = false","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Now you can quit Julia with the command exit(). If you want to launch Julia again, be sure to be in the correct folder and then type julia --project. Without the parameter --project it will not load your project settings.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"The first run of the script will be slow because Julia must compile the code. The second and any further run is very fast, but only as long as you do not leave your Julia session.","category":"page"},{"location":"quickstart/#Comparing-the-one-point-and-the-four-point-kite-model","page":"Quickstart","title":"Comparing the one-point and the four-point kite model","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Start Julia in the project folder you created before:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"cd test\njulia --project","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"and then execute the command","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"using KiteModels\ninclude(\"examples/compare_kps3_kps4.jl\")","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Use the command include(\"examples\\\\compare_kps3_kps4.jl\") on Windows.","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"The last view of the animation should look like this:","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"(Image: Initial State)","category":"page"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"You can save what you see with the command savefig(\"kite.png\").","category":"page"},{"location":"quickstart/#Exercise","page":"Quickstart","title":"Exercise","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"Modify the variable ALPHA_ZERO in line 11 of the script until the lift force of the 1 point model and the 4 point model match.","category":"page"},{"location":"quickstart/#Questions?","page":"Quickstart","title":"Questions?","text":"","category":"section"},{"location":"quickstart/","page":"Quickstart","title":"Quickstart","text":"If you have any questions, please ask in the Julia Discourse forum in the section modelling and simulation , or in in the section First steps . The Julia community is very friendly and responsive.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"CurrentModule = KiteModels","category":"page"},{"location":"examples/#Examples-for-using-the-one-point-kite-model","page":"Examples_1p","title":"Examples for using the one point kite model","text":"","category":"section"},{"location":"examples/#Create-a-test-project","page":"Examples_1p","title":"Create a test project","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"mkdir test\ncd test\njulia --project=\".\"","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"With the last command, we told Julia to create a new project in the current directory.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Then we add the three required packages to our new project. By pressing the key \"]\" we enter the package manager mode where we can add or delete packages.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"]\nadd KiteUtils\nadd KitePodModels\nadd KiteModels\nst\n","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"The command \"st\" was not really required, but it is useful to display which versions of the packages we have in our project. Another important package manager command is the command \"up\", which updates all packages to the latest compatible versions.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Then, copy the default configuration files and examples to your new project:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"using KiteModels\ncopy_settings()\ncopy_examples()","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"The first command copies the files settings.yaml and system.yaml to the folder data. They can be customized later. The second command creates an examples folder with some examples.","category":"page"},{"location":"examples/#Plotting-the-initial-state","page":"Examples_1p","title":"Plotting the initial state","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"First, an instance of the model of the kite control unit (KCU) is created which is needed by the Kite Power System model KPS3. Then we create a kps instance, passing the kcu model as parameter. We need to declare the type these variables to achieve a decent performance.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"using KiteModels\nkcu::KCU = KCU(se())\nkps::KPS3 = KPS3(kcu)","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Then we call the function find_steady_state which uses a non-linear solver to find the solution for a given elevation angle, reel-out speed and wind speed. ","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"find_steady_state!(kps, prn=true)","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"To plot the result in 2D we extract the vectors of the x and z coordinates of the tether particles with a for loop:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"x = Float64[] \nz = Float64[]\nfor i in 1:length(kps.pos)\n push!(x, kps.pos[i][1])\n push!(z, kps.pos[i][3])\nend","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"And finally, we plot the position of the particles in the x-z plane. When you type using ControlPlots you will be asked if you want to install the ControlPlots package. Just press \\ and it gets installed.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"using ControlPlots\nplot(x,z, xlabel=\"x [m]\", ylabel=\"z [m]\", scatter=true)","category":"page"},{"location":"examples/#Inital-State","page":"Examples_1p","title":"Inital State","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"(Image: Initial State)","category":"page"},{"location":"examples/#Print-other-model-outputs","page":"Examples_1p","title":"Print other model outputs","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the vector of the positions of the particles:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> kps.pos\n7-element StaticArrays.SVector{7, StaticArrays.MVector{3, Float64}} with indices SOneTo(7):\n [0.0, 0.0, 0.0]\n [26.95751778658999, 0.0, 59.59749511924355]\n [51.97088814144287, 0.0, 120.03746888266994]\n [75.01423773175357, 0.0, 181.25637381120865]\n [96.06809940556136, 0.0, 243.18841293054678]\n [115.11959241520753, 0.0, 305.7661763854397]\n [132.79571663189674, 0.0, 368.74701279158705]\n","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the unstretched and stretched tether length and the height of the kite:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> unstretched_length(kps)\n150.0\n\njulia> tether_length(kps)\n150.1461801769623\n\njulia> calc_height(kps)\n142.78102261557189","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the force at the winch (groundstation, in Newton) and at each tether segment:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> winch_force(kps)\n592.5649922210812\n\njulia> spring_forces(kps)\n6-element Vector{Float64}:\n 592.5534481632459\n 595.0953689567787\n 597.6497034999358\n 600.215921248686\n 602.793488771366\n 605.3855398009119","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"The force increases when going upwards because the kite not only experiences the winch force but in addition the weight of the tether.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the lift and drag forces of the kite (in Newton) and the lift-over-drag ratio:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> lift, drag = lift_drag(kps)\n(730.5877517655691, 157.36420900755007)\n\njulia> lift_over_drag(kps)\n4.64265512706588","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"Print the wind speed vector at the kite:","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"julia> v_wind_kite(kps)\n3-element StaticArrays.MVector{3, Float64} with indices SOneTo(3):\n 12.54966091924401\n 0.0\n 0.0","category":"page"},{"location":"examples/#Example-of-reeling-out-the-tether","page":"Examples_1p","title":"Example of reeling out the tether","text":"","category":"section"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"include(\"examples/reel_out_1p.jl\")","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"(Image: Reel out 1p model)","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"In this example, we first keep the tether length constant and at 15 s start to reel out the winch with an acceleration of 0.1 m/s². At a set speed below 2.2 m/s the brake of the winch is active, therefore the \"jump\" in the v_reelout at the beginning of the reel-out phase.","category":"page"},{"location":"examples/","page":"Examples_1p","title":"Examples_1p","text":"It is not a real jump, but a high acceleration compared to the acceleration afterward.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"CurrentModule = KiteModels","category":"page"},{"location":"advanced/#Advanced-usage","page":"Advanced usage","title":"Advanced usage","text":"","category":"section"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"For advanced users it is suggested to install git, bash and vscode or vscodium in addition to Julia. vscode and vscodium both have a very good plugin for Julia support, see https://www.julia-vscode.org. For Windows users, you can find some installation instructions here: Julia on Windows .","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Whe using vscode, I do NOT use the Julia terminal provided by vscode, but the normal bash terminal which is also available in vscode by selecting Terminal->New Terminal From this terminal I start Julia with julia --project or a different command as explained below. This makes it easier to understand what happens and is also faster when you need to restart.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"For Ubuntu Linux I use the following ppa to install vscode and to keep it up-to-date: https://www.ubuntuupdates.org/ppa/vscode .","category":"page"},{"location":"advanced/#Creating-a-custom-system-image","page":"Advanced usage","title":"Creating a custom system image","text":"","category":"section"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"To reduce the startup time it is suggested to use a custom system image that contains all the packages you use on a daily base in compiled form.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"For end users, follow the instructions on KiteSimulators . Package developers can follow these instructions:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Go to the website https://github.com/ufechner7/KiteModels.jl and click on the Fork button at the top right.\nclone the new repository which is owned by you with a command similar to this one: git clone https://github.com/aenarete/KiteModels.jl Your own git user name must appear in the URL, otherwise you will not be able to push your changes.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"From a bash prompt you can create one using the following commands, assuming you created a folder \"test\" as explained on the Quickstart page:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"cd KiteModels.jl\njulia --project","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"using Pkg\nPkg.instantiate()\nPkg.precompile()","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"If you enter shell mode by pressing \";\" and type the command treeyou should see the following files:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"shell> tree\n.\n├── bin\n│   ├── create_sys_image\n│   ├── create_sys_image2\n│   ├── run_julia\n│   └── run_julia2\n├── data\n│   ├── settings.yaml\n│   └── system.yaml\n├── docs\n│   ├── data\n│   ├── make.jl\n│   ├── Project.toml\n│   └── src\n│   ├── 4-point-kite.png\n│   ├── advanced.md\n│   ├── assets\n│   │   └── logo.png\n│   ├── examples_4p.md\n│   ├── examples.md\n│   ├── functions.md\n│   ├── index.md\n│   ├── initial_state_4p.png\n│   ├── initial_state.png\n│   ├── kite.png\n│   ├── kite_power_tools.png\n│   ├── kps4_hires.png\n│   ├── kps4.png\n│   ├── parameters.md\n│   ├── quickstart.md\n│   └── types.md\n├── examples\n│   ├── compare_kps3_kps4.jl\n│   ├── plot2d.jl\n│   ├── reel_out.jl\n│   ├── simulate_ii.jl\n│   └── simulate_simple.jl\n├── LICENSE\n├── Manifest-1.7.toml.default\n├── Manifest-1.8.toml.default\n├── Manifest.toml\n├── Project.toml\n├── README.md\n├── src\n│   ├── init.jl\n│   ├── KiteModels.jl\n│   ├── KPS3.jl\n│   └── KPS4.jl\n└── test\n ├── bench3.jl\n ├── bench4.jl\n ├── create_sys_image2.jl\n ├── create_sys_image.jl\n ├── plot2d.jl\n ├── plot_initial_state.jl\n ├── plot_kps3.jl\n ├── plot_kps4.jl\n ├── runtests.jl\n ├── test_for_precompile.jl\n ├── test_kps3.jl\n ├── test_kps4.jl\n ├── test_staticarrays.jl\n ├── test_steady_state.jl\n ├── test_sundials.jl\n └── update_packages.jl\n\n9 directories, 55 files","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Now leave Julia with the command exit() and then type:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"cd bin\n./create_sys_image --update","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"This will take about 6 min on a i7-10510U CPU. You should now see a new file in the bin folder:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"~/repos/test/bin$ ls -lah kps*\n-rwxrwxr-x 1 ufechner ufechner 344M apr 18 18:23 kps-image-1.7.so","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"You can launch julia such that it makes use of this system image with the commands:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"cd ..\n./bin/run_julia","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"If you now run any of the examples the time-to-first-plot (TTFP) should be less than 25s:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"julia> @time include(\"examples/simulate_simple.jl\")\nlift, drag [N]: 597.61, 129.33\nAverage number of callbacks per time step: 481.845\n 23.901076 seconds (63.42 M allocations: 12.686 GiB, 5.67% gc time, 70.62% compilation time)\n\njulia> ","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"A second run of this command needs about 5.5 s which means the startup time (load and compilation time of the package and the libraries) has been reduced to about 18.4s.","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Without a system image the first time execution of the script \"simulate_simple.jl\" on the same computer is about 71 seconds while the time for the second execution is the same (5.5s). So now about 47s of time are saved after each restart.","category":"page"},{"location":"advanced/#Hints-for-Developers","page":"Advanced usage","title":"Hints for Developers","text":"","category":"section"},{"location":"advanced/#Coding-style","page":"Advanced usage","title":"Coding style","text":"","category":"section"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"add the packages TestEnv and Revise to your global environment, not to any project\navoid hard-coded numeric values like 9.81 in the code, instead define a global constant G_EARTH or read this value from a configuration file\nstick to a line length limit of 120 characters\ntry to avoid dot operators unless you have to. ","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"Bad: norm1 .~ norm(segment) Good: norm1 ~ norm(segment)","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"if you need to refer to the settings you can use se() which will load the settings of the active project. To define the active project use a line like set = se(\"system_3l.yaml\") at the beginning of your program.\nuse the \\cdot operator for the dot product for improved readability\nuse a space after a comma, e.g. force_eqs[j, i]\nenclose operators like + and * in single spaces, like 0.5 * (s.pos[s.num_C] + s.pos[s.num_D]); exception: mass_tether_particle[i-1]\ntry to align the equation signs for improved readability like this:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":" tether_rhs = [force_eqs[j, i].rhs for j in 1:3]\n kite_rhs = [force_eqs[j, i+3].rhs for j in 1:3]\n f_xy = dot(tether_rhs, e_z) * e_z","category":"page"},{"location":"advanced/#Outlook","page":"Advanced usage","title":"Outlook","text":"","category":"section"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"The next steps:","category":"page"},{"location":"advanced/","page":"Advanced usage","title":"Advanced usage","text":"re-implement the KPS4 model using ModelingToolkit\nadd a Matlab/ Simulink wrapper similar to the Python wrapper pykitemodels","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"CurrentModule = KiteModels","category":"page"},{"location":"examples_4p/#Examples-for-using-the-four-point-kite-model","page":"Examples_4p","title":"Examples for using the four point kite model","text":"","category":"section"},{"location":"examples_4p/#Create-a-test-project","page":"Examples_4p","title":"Create a test project","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"mkdir test\ncd test\njulia --project=\".\"","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"With the last command, we told Julia to create a new project in the current directory.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Then we add the three required packages to our new project. By pressing the key \"]\" we enter the package manager mode where we can add or delete packages.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"]\nadd KiteUtils\nadd KitePodModels\nadd KiteModels\nst\n","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"The command \"st\" was not really required, but it is useful to display which versions of the packages we have in our project. Another important package manager command is the command \"up\", which updates all packages to the latest compatible versions.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Then, copy the default configuration files and examples to your new project:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"using KiteModels\ncopy_settings()\ncopy_examples()","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"The first command copies the files settings.yaml and system.yaml to the folder data. They can be customized later. The second command creates an examples folder with some examples.","category":"page"},{"location":"examples_4p/#Plotting-the-initial-state","page":"Examples_4p","title":"Plotting the initial state","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"First, an instance of the model of the kite control unit (KCU) is created which is needed by the Kite Power System model KPS3. Then we create a kps instance, passing the kcu model as parameter. We need to declare these variables as const to achieve a decent performance.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"using KiteModels\nkcu::KCU = KCU(se())\nkps = KPS4(kcu)","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Then we call the function find_steady_state which uses a non-linear solver to find the solution for a given elevation angle, reel-out speed and wind speed. ","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"find_steady_state!(kps, prn=true)","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Finding the steady state of the 4-point model is difficult and it only works when we artificially reduce the stiffness by a factor of 0.035. In the function init_sim! this factor is slowly increased to 1.0.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"To plot the result in 2D we extract the vectors of the x and z coordinates of the tether particles with a for loop:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"x = Float64[] \nz = Float64[]\nfor i in 1:length(kps.pos)\n push!(x, kps.pos[i][1])\n push!(z, kps.pos[i][3])\nend","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"And finally, we plot the position of the particles in the x-z plane. When you type using ControlPlots you will be asked if you want to install the ControlPlots package. Just press \\ and it gets installed.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"using ControlPlots\nplot(x,z, xlabel=\"x [m]\", ylabel=\"z [m]\", scatter=true)","category":"page"},{"location":"examples_4p/#Initial-State","page":"Examples_4p","title":"Initial State","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"(Image: Initial State)","category":"page"},{"location":"examples_4p/#Print-other-model-outputs","page":"Examples_4p","title":"Print other model outputs","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the vector of the positions of the particles:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> kps.pos\n11-element StaticArrays.SVector{11, StaticArrays.MVector{3, Float64}} with indices SOneTo(11):\n [0.0, 0.0, 0.0]\n [9.179237622840555, 0.0, 23.842235605018427]\n [18.04995989861643, 0.0, 47.800963572571995]\n [26.562156210544767, 0.0, 71.88939923189402]\n [34.68610302268368, 0.0, 96.11152960655927]\n [42.39897331360162, 0.0, 120.4676716318371]\n [49.681585065247006, 0.0, 144.95590371155842]\n [50.19560621291923, 0.0, 150.01396766608025]\n [51.447158096922415, 0.0, 152.22064860101747]\n [51.269841233250816, 2.823293379900761, 149.7849943282592]\n [51.269841233250816, -2.823293379900761, 149.7849943282592]\n","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the unstretched and stretched tether length and the height of the kite:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> unstretched_length(kps)\n150.0\n\njulia> tether_length(kps)\n153.28916318946136\n\njulia> calc_height(kps)\n152.22064860101747","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Because of the the stiffness_factor of 0.035 we have a longer tether-length then when using the 1 point kite model. ","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the force at the winch (groundstation, in Newton) and at each tether segment:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> winch_force(kps)\n471.70242280223385\n\njulia> spring_forces(kps)\n15-element Vector{Float64}:\n 471.6945339755092\n 471.690450982437\n 471.6880774303635\n 471.68627774821994\n 471.68477542957345\n 471.68345917403485\n 95.87508612176553\n -58.70207142208335\n -50.06490404375146\n 226.23422847228494\n 215.8389386786939\n 215.8389386786939\n 226.23422847228494\n -58.70207142208335\n 99.72953663093385","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Some of the forces are negative which means the segments are getting compressed. This is acceptable for the kite itself (not for the tether).","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the lift and drag forces of the kite (in Newton) and the lift-over-drag ratio:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> lift, drag = lift_drag(kps)\n(382.18880762331327, 117.58827293691883)\n\njulia> lift_over_drag(kps)\n3.250228939312184","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"Print the wind speed vector at the kite:","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"julia> v_wind_kite(kps)\n3-element StaticArrays.MVector{3, Float64} with indices SOneTo(3):\n 12.542508333667467\n 0.0\n 0.0","category":"page"},{"location":"examples_4p/#Example-of-reeling-out-the-tether","page":"Examples_4p","title":"Example of reeling out the tether","text":"","category":"section"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"include(\"examples/reel_out_4p.jl\")","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"(Image: Reel out 4p model)","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"In this example, we first keep the tether length constant and at 15 s start to reel out the winch with an acceleration of 0.1 m/s². At a set speed below 2.2 m/s the brake of the winch is active, therefore the \"jump\" in the v_reelout at the beginning of the reel-out phase.","category":"page"},{"location":"examples_4p/","page":"Examples_4p","title":"Examples_4p","text":"It is not a real jump, but a high acceleration compared to the acceleration afterward.","category":"page"},{"location":"","page":"Home","title":"Home","text":"CurrentModule = KiteModels","category":"page"},{"location":"#KiteModels","page":"Home","title":"KiteModels","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Documentation for the package KiteModels.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The model has the following subcomponents, implement in separate packages:","category":"page"},{"location":"","page":"Home","title":"Home","text":"AtmosphericModel from AtmosphericModels\nWinchModel from WinchModels \nKitePodModel from KitePodModels","category":"page"},{"location":"","page":"Home","title":"Home","text":"This package is part of Julia Kite Power Tools, which consist of the following packages:","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: Julia Kite Power Tools)","category":"page"},{"location":"#What-to-install","page":"Home","title":"What to install","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you want to run simulations and see the results in 3D, please install the meta package KiteSimulators which contains all other packages. If you are not interested in 3D visualization or control you can just install this package. When you have installed the package KiteSimulators, use the command using KiteSimulators instead of using KiteModels when this is mentioned in the documentation.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Install Julia 1.10 or later, if you haven't already. Before installing this software it is suggested to create a new project, for example like this:","category":"page"},{"location":"","page":"Home","title":"Home","text":"mkdir test\ncd test\njulia --project=\".\"","category":"page"},{"location":"","page":"Home","title":"Home","text":"Now add KiteModels from Julia's package manager, by typing ","category":"page"},{"location":"","page":"Home","title":"Home","text":"using Pkg\npkg\"add KiteModels\"","category":"page"},{"location":"","page":"Home","title":"Home","text":"at the Julia prompt. You can run the unit tests with the command:","category":"page"},{"location":"","page":"Home","title":"Home","text":"pkg\"test KiteModels\"","category":"page"},{"location":"","page":"Home","title":"Home","text":"You can copy the examples to your project with:","category":"page"},{"location":"","page":"Home","title":"Home","text":"using KiteModels\nKiteModels.install_examples()","category":"page"},{"location":"","page":"Home","title":"Home","text":"This also adds the extra packages, needed for the examples to the project. Furthermore, it creates a folder data with some example input files. You can now run the examples with the command:","category":"page"},{"location":"","page":"Home","title":"Home","text":"include(\"examples/menu.jl\")","category":"page"},{"location":"#News","page":"Home","title":"News","text":"","category":"section"},{"location":"#August-2024","page":"Home","title":"August 2024","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"a new kite model, KPS3_3L was contributed. It uses three lines to the ground and three winches for steering a ram-air foil kite.\na new KCU model was added which assumes a linear relationship between the depower settings and the depower angle and thus is easier to configure than the original model.","category":"page"},{"location":"#July-2024","page":"Home","title":"July 2024","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"a new groundstation / winch-type is now supported, the TorqueControlledMachine. It can be configured in the section winch of the settings.yaml file. It uses a set torque as input.\na Python interface is now provided, see: pykitemodels","category":"page"},{"location":"#April-2024","page":"Home","title":"April 2024","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"added support for the native Julia DAE solver DFBDF. It is much more accurate and faster than the IDA solver that was used before.","category":"page"},{"location":"#Provides","page":"Home","title":"Provides","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The type AbstractKiteModel with the implementation KPS3, KPS4 and KPS4_3L, representing the one point, the four point kite model and the four point - three lines model, together with the high level simulation interface consisting of the functions init_sim! and next_step!. Other kite models can be added inside or outside of this package by implementing the non-generic methods required for an AbstractKiteModel.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Additional functions to provide inputs and outputs of the model on each time step. In particular the constructor SysState can be called once per time step to create a SysState struct for logging or for displaying the state in a viewer. Per time step the residual! function is called as many times as needed to find the solution at the end of the time step. The formulas are based on basic physics and aerodynamics and can be quite simple because a differential algebraic notation is used.","category":"page"},{"location":"","page":"Home","title":"Home","text":"(Image: Four point kite power system model)","category":"page"},{"location":"#Reference-frames-and-control-inputs","page":"Home","title":"Reference frames and control inputs","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"a positive set_torque will accelerate the reel-out, a negative set_torque counteract the pulling force of the kite. The unit is [N/m] as seen at the motor/generator axis.\nthe depower settings are dimensionless and can be between zero and one. A value equal to mathrmdepower_zero100 from the settings.yaml file means that the kite is fully powered. ","category":"page"},{"location":"","page":"Home","title":"Home","text":"A definition of the reference frames can be found here .","category":"page"},{"location":"#Further-reading","page":"Home","title":"Further reading","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The one point and four point kite models are described in detail in Dynamic Model of a Pumping Kite Power System.","category":"page"},{"location":"#See-also","page":"Home","title":"See also","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Research Fechner for the scientic background of this code\nThe application KiteViewer\nthe package KiteUtils\nthe packages WinchModels and KitePodModels and AtmosphericModels\nthe packages KiteControllers and KiteViewers","category":"page"},{"location":"","page":"Home","title":"Home","text":"Authors: Uwe Fechner (uwe.fechner.msc@gmail.com) and Bart van de Lint","category":"page"},{"location":"parameters/","page":"Parameters","title":"Parameters","text":"CurrentModule = KiteModels","category":"page"},{"location":"parameters/#Configuration","page":"Parameters","title":"Configuration","text":"","category":"section"},{"location":"parameters/","page":"Parameters","title":"Parameters","text":"To configure the parameters of the kite models, edit the file data/settings.yaml, or create a copy under a different name and change the name of the active configuration in the file data/system.yaml.","category":"page"},{"location":"parameters/#Parameters","page":"Parameters","title":"Parameters","text":"","category":"section"},{"location":"parameters/","page":"Parameters","title":"Parameters","text":"The following parameters are used by this package:","category":"page"},{"location":"parameters/","page":"Parameters","title":"Parameters","text":"system:\n sample_freq: 20 # sample frequency in Hz\n\ninitial:\n l_tether: 150.0 # initial tether length [m]\n elevation: 70.7 # initial elevation angle [deg]\n v_reel_out: 0.0 # initial reel out speed [m/s]\n depower: 25.0 # initial depower settings [%]\n\nsolver:\n abs_tol: 0.0006 # absolute tolerance of the DAE solver [m, m/s]\n rel_tol: 0.001 # relative tolerance of the DAE solver [-]\n linear_solver: \"GMRES\" # can be GMRES or Dense\n max_order: 4 # maximal order, usually between 3 and 5\n max_iter: 200 # max number of iterations of the steady-state-solver\n\nsteering:\n c0: 0.0 # steering offset -0.0032 [-]\n c_s: 2.59 # steering coefficient one point model\n c2_cor: 0.93 # correction factor one point model\n k_ds: 1.5 # influence of the depower angle on the steering sensitivity\n\ndepower:\n alpha_d_max: 31.0 # max depower angle [deg]\n \nkite:\n model: \"data/kite.obj\" # 3D model of the kite\n mass: 6.2 # kite mass incl. sensor unit [kg]\n area: 10.18 # projected kite area [m²]\n rel_side_area: 30.6 # relative side area [%]\n height: 2.23 # height of the kite [m]\n alpha_cl: [-180.0, -160.0, -90.0, -20.0, -10.0, -5.0, 0.0, 20.0, 40.0, 90.0, 160.0, 180.0]\n cl_list: [ 0.0, 0.5, 0.0, 0.08, 0.125, 0.15, 0.2, 1.0, 1.0, 0.0, -0.5, 0.0]\n alpha_cd: [-180.0, -170.0, -140.0, -90.0, -20.0, 0.0, 20.0, 90.0, 140.0, 170.0, 180.0]\n cd_list: [ 0.5, 0.5, 0.5, 1.0, 0.2, 0.1, 0.2, 1.0, 0.5, 0.5, 0.5]\n \nkps4:\n width: 5.77 # width of the kite [m]\n alpha_zero: 4.0 # should be 5 [degrees]\n alpha_ztip: 10.0 # [degrees]\n m_k: 0.2 # relative nose distance; increasing m_k increases C2 of the turn-rate law\n rel_nose_mass: 0.47 # relative nose mass\n rel_top_mass: 0.4 # mass of the top particle relative to the sum of top and side particles\n\nbridle:\n d_line: 2.5 # bridle line diameter [mm]\n l_bridle: 33.4 # sum of the lengths of the bridle lines [m]\n h_bridle: 4.9 # height of bridle [m]\n\nkcu:\n kcu_mass: 8.4 # mass of the kite control unit [kg]\n\ntether:\n d_tether: 4 # tether diameter [mm]\n cd_tether: 0.958 # drag coefficient of the tether\n damping: 473.0 # unit damping coefficient [Ns]\n c_spring: 614600.0 # unit spring constant coefficient [N]\n rho_tether: 724.0 # density of Dyneema [kg/m³]\n\nenvironment:\n v_wind: 9.51 # wind speed at reference height [m/s]\n h_ref: 6.0 # reference height for the wind speed [m]\n\n rho_0: 1.225 # air density at the ground or zero [kg/m³]\n alpha: 0.08163 # exponent of the wind profile law\n z0: 0.0002 # surface roughness [m]\n profile_law: 6 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG","category":"page"},{"location":"types/#Exported-Types","page":"Types","title":"Exported Types","text":"","category":"section"},{"location":"types/","page":"Types","title":"Types","text":"CurrentModule = KiteModels","category":"page"},{"location":"types/#Basic-types","page":"Types","title":"Basic types","text":"","category":"section"},{"location":"types/","page":"Types","title":"Types","text":"SimFloat\nKVec3\nSVec3\nAbstractKiteModel\nAKM","category":"page"},{"location":"types/#KiteModels.SimFloat","page":"Types","title":"KiteModels.SimFloat","text":"const SimFloat = Float64\n\nThis type is used for all real variables, used in the Simulation. Possible alternatives: Float32, Double64, Dual Other types than Float64 or Float32 do require support of Julia types by the solver. \n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.KVec3","page":"Types","title":"KiteModels.KVec3","text":"const KVec3 = MVector{3, SimFloat}\n\nBasic 3-dimensional vector, stack allocated, mutable.\n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.SVec3","page":"Types","title":"KiteModels.SVec3","text":"const SVec3 = SVector{3, SimFloat}\n\nBasic 3-dimensional vector, stack allocated, immutable.\n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.AbstractKiteModel","page":"Types","title":"KiteModels.AbstractKiteModel","text":"abstract type AbstractKiteModel\n\nAll kite models must inherit from this type. All methods that are defined on this type must work with all kite models. All exported methods must work on this type. \n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.AKM","page":"Types","title":"KiteModels.AKM","text":"const AKM = AbstractKiteModel\n\nShort alias for the AbstractKiteModel. \n\n\n\n\n\n","category":"type"},{"location":"types/#Struct-KPS3-and-KPS4-and-KPS4_3L","page":"Types","title":"Struct KPS3 and KPS4 and KPS4_3L","text":"","category":"section"},{"location":"types/","page":"Types","title":"Types","text":"KPS3\nKPS4\nKPS4_3L","category":"page"},{"location":"types/#KiteModels.KPS3","page":"Types","title":"KiteModels.KPS3","text":"mutable struct KPS3{S, T, P} <: AbstractKiteModel\n\nState of the kite power system. Parameters:\n\nS: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.\nT: Vector type, e.g. MVector{3, SimFloat}\nP: number of points of the system, segments+1\n\nNormally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.\n\nset::Settings: Reference to the settings struct\nkcu::KCU: Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels\nam::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()\nwm::Union{Nothing, AbstractWinchModel}: Reference to winch model as implemented in the package WinchModels Default: nothing\niter::Int64: Iterations, number of calls to the function residual! Default: 0\ncalc_cl::Dierckx.Spline1D: Function for calculation the lift coefficent, using a spline based on the provided value pairs.\ncalc_cd::Dierckx.Spline1D: Function for calculation the drag coefficent, using a spline based on the provided value pairs.\nv_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)\nv_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)\nv_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)\nv_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)\nv_app_perp::Any: vector, perpendicular to vapparent; output of calcdrag Default: zeros(S, 3)\ndrag_force::Any: drag force of kite and bridle; output of calcaeroforces Default: zeros(S, 3)\nlift_force::Any: lift force of the kite; output of calcaeroforces Default: zeros(S, 3)\nsteering_force::Any: steering force acting on the kite; output of calcaeroforces Default: zeros(S, 3)\nlast_force::Any: Default: zeros(S, 3)\nspring_force::Any: spring force of the current tether segment, output of calc_res Default: zeros(S, 3)\ntotal_forces::Any: Default: zeros(S, 3)\nforce::Any: sum of spring and drag forces acting on the current segment, output of calc_res Default: zeros(S, 3)\nunit_vector::Any: unit vector in the direction of the current tether segment, output of calc_res Default: zeros(S, 3)\nav_vel::Any: average velocity of the current tether segment, output of calc_res Default: zeros(S, 3)\nkite_y::Any: y-vector of the kite fixed referense frame, output of calcaeroforces Default: zeros(S, 3)\nsegment::Any: vector representing one tether segment (p1-p2) Default: zeros(S, 3)\nlast_tether_drag::Any: vector of the drag force of the last calculated tether segment Default: zeros(S, 3)\nvec_z::Any: z vector of the kite reference frame Default: zeros(S, 3)\nres1::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: part one of the residual, difference between pos' and vel, non-flat, mainly for unit testing Default: zeros(SVector{P, KVec3})\nres2::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: part two of the residual, difference between vel' and acc, non-flat, mainly for unit testing Default: zeros(SVector{P, KVec3})\npos::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the positions of the particles Default: zeros(SVector{P, KVec3})\nvel_kite::Any: velocity vector of the kite Default: zeros(S, 3)\nseg_area::Any: area of one tether segment [m²] Default: zero(S)\nbridle_area::Any: total actual bridle area [m²] Default: zero(S)\nc_spring::Any: spring constant, depending on the length of the tether segment Default: zero(S)\nsegment_length::Any: unstressed segment length [m] Default: 0.0\ndamping::Any: damping factor, depending on the length of the tether segment Default: zero(S)\nlast_v_app_norm_tether::Any: last norm of the apparent wind speed at a tether segment [m/s] Default: zero(S)\nparam_cl::Any: lift coefficient of the kite, depending on the angle of attack Default: 0.2\nparam_cd::Any: drag coefficient of the kite, depending on the angle of attack Default: 1.0\ncor_steering::Any: correction term for the steering, in paper named i_(s,c), Eq. 30 Default: zero(S)\npsi::Any: azimuth angle in radian; inital value is zero Default: zero(S)\nbeta::Any: elevation angle in radian; initial value about 70 degrees Default: deg2rad((se()).elevation)\nalpha_depower::Any: depower angle [deg] Default: 0.0\nt_0::Any: relative start time of the current time interval Default: 0.0\nv_reel_out::Any: reel out speed of the winch [m/s] Default: 0.0\nlast_v_reel_out::Any: reel out speed during the last time step Default: 0.0\nl_tether::Any: unstretched tether length Default: 0.0\nrho::Any: air density at the height of the kite Default: 0.0\ndepower::Any: actual relative depower setting, must be between 0 .. 1.0 Default: 0.0\nsteering::Any: actual relative steering setting, must be between -1.0 .. 1.0 Default: 0.0\nstiffness_factor::Any: factor for the tether stiffness, used to find the steady state with a low stiffness first Default: 1.0\ninitial_masses::StaticArraysCore.MVector{P, S} where {S, P}: initial masses of the point masses Default: ones(P)\nmasses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: ones(P)\nforces::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the forces, acting on the particles Default: zeros(SVector{P, KVec3})\nsync_speed::Union{Nothing, S} where S: synchronous speed of the motor/ generator Default: 0.0\nset_torque::Union{Nothing, S} where S: set_torque of the motor/generator Default: nothing\n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.KPS4","page":"Types","title":"KiteModels.KPS4","text":"mutable struct KPS4{S, T, P, Q, SP} <: AbstractKiteModel\n\nState of the kite power system, using a 4 point kite model. Parameters:\n\nS: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.\nT: Vector type, e.g. MVector{3, SimFloat}\nP: number of points of the system, segments+1\nQ: number of springs in the system, P-1\nSP: struct type, describing a spring\n\nNormally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.\n\nset::Settings: Reference to the settings struct\nkcu::KCU: Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels\nam::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()\nwm::AbstractWinchModel: Reference to winch model as implemented in the package WinchModels\niter::Int64: Iterations, number of calls to the function residual! Default: 0\ncalc_cl::Dierckx.Spline1D: Function for calculation the lift coefficent, using a spline based on the provided value pairs.\ncalc_cd::Dierckx.Spline1D: Function for calculation the drag coefficent, using a spline based on the provided value pairs.\nv_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)\nv_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)\nv_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)\nv_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)\nbridle_factor::Any: bridlefactor = set.lbridle/bridle_length(set) Default: 1.0\nside_cl::Any: side lift coefficient, the difference of the left and right lift coeficients Default: 0.0\ndrag_force::Any: drag force of kite and bridle; output of calcaeroforces! Default: zeros(S, 3)\nside_force::Any: side_force acting on the kite Default: zeros(S, 3)\nks::Any: max_steering angle in radian Default: 0.0\nlift_force::Any: lift force of the kite; output of calcaeroforces! Default: zeros(S, 3)\nspring_force::Any: spring force of the current tether segment, output of calcparticleforces! Default: zeros(S, 3)\nlast_force::Any: last winch force Default: zeros(S, 3)\nres1::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the residual one (pos,vel) for debugging and unit tests Default: zeros(SVector{P, KVec3})\nres2::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the residual two (vel,acc) for debugging and unit tests Default: zeros(SVector{P, KVec3})\npos::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the actual positions as output for the user Default: zeros(SVector{P, KVec3})\nvel_kite::Any: velocity vector of the kite Default: zeros(S, 3)\nsegment_length::Any: unstressed segment length [m] Default: 0.0\nparam_cl::Any: lift coefficient of the kite, depending on the angle of attack Default: 0.2\nparam_cd::Any: drag coefficient of the kite, depending on the angle of attack Default: 1.0\npsi::Any: azimuth angle in radian; inital value is zero Default: zero(S)\nalpha_depower::Any: depower angle [deg] Default: 0.0\nalpha_2::Any: aoa at paricle B Default: 0.0\nalpha_2b::Any: aoa at paricle B, corrected formula Default: 0.0\nalpha_3::Any: aoa at paricle C Default: 0.0\nalpha_3b::Any: Default: 0.0\nalpha_4::Any: aoa at paricle D Default: 0.0\nalpha_4b::Any: Default: 0.0\nt_0::Any: relative start time of the current time interval Default: 0.0\nv_reel_out::Any: reel out speed of the winch Default: 0.0\nlast_v_reel_out::Any: reel out speed at the last time step Default: 0.0\nl_tether::Any: unstretched tether length Default: 0.0\nrho::Any: air density at the height of the kite Default: 0.0\ndepower::Any: actual relative depower setting, must be between 0 .. 1.0 Default: 0.0\nsteering::Any: actual relative steering setting, must be between -1.0 .. 1.0 Default: 0.0\nstiffness_factor::Any: multiplier for the stiffniss of tether and bridle Default: 1.0\ninitial_masses::StaticArraysCore.MVector{P, S} where {S, P}: initial masses of the point masses Default: ones(P)\nmasses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: zeros(P)\nsprings::StaticArraysCore.MVector: vector of the springs, defined as struct Default: zeros(SP, Q)\nforces::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the forces, acting on the particles Default: zeros(SVector{P, KVec3})\nsync_speed::Union{Nothing, S} where S: synchronous speed of the motor/ generator Default: 0.0\nset_torque::Union{Nothing, S} where S: set_torque of the motor/generator Default: nothing\nx::Any: x vector of kite reference frame Default: zeros(S, 3)\ny::Any: y vector of kite reference frame Default: zeros(S, 3)\nz::Any: z vector of kite reference frame Default: zeros(S, 3)\n\n\n\n\n\n","category":"type"},{"location":"types/#KiteModels.KPS4_3L","page":"Types","title":"KiteModels.KPS4_3L","text":"mutable struct KPS4_3L{S, T, P, Q, SP} <: AbstractKiteModel\n\nState of the kite power system, using a 3 point kite model and three steering lines to the ground. Parameters:\n\nS: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.\nT: Vector type, e.g. MVector{3, SimFloat}\nP: number of points of the system, segments+3\nQ: number of springs in the system, P-1\nSP: struct type, describing a spring\n\nNormally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.\n\nset::Settings: Reference to the settings struct\nset_hash::UInt64: Reference to the settings hash Default: 0\nlast_init_elevation::Float64: The last initial elevation Default: 0.0\nlast_init_tether_length::Float64: The last initial tether length Default: 0.0\nlast_set_hash::UInt64: Reference to the last settings hash Default: 0\nam::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()\ncalc_cl::Any: Function for calculation the lift coefficent, using a spline based on the provided value pairs. Default: Spline1D((se()).alphacl, (se()).cllist)\ncalc_cd::Any: Function for calculation the drag coefficent, using a spline based on the provided value pairs. Default: Spline1D((se()).alphacd, (se()).cdlist)\nmotors::StaticArraysCore.SVector{3, AbstractWinchModel}: Reference to the motor models as implemented in the package WinchModels. index 1: middle motor, index 2: left motor, index 3: right motor\niter::Int64: Iterations, number of calls to the function residual! Default: 0\nv_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)\nv_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)\nv_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)\nv_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)\nwinch_forces::StaticArraysCore.SVector{3}: last winch force Default: [zeros(S, 3) for _ = 1:3]\nres1::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the residual one (pos,vel) for debugging and unit tests Default: zeros(SVector{P, T})\nres2::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the residual two (vel,acc) for debugging and unit tests Default: zeros(SVector{P, T})\npos::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the actual positions as output for the user Default: zeros(SVector{P, T})\nvel::StaticArraysCore.SVector{P, T} where {T, P}: Default: zeros(SVector{P, T})\nveld::StaticArraysCore.SVector{P, T} where {T, P}: Default: zeros(SVector{P, T})\nvel_kite::Any: velocity vector of the kite Default: zeros(S, 3)\nsegment_lengths::Any: unstressed segment lengths of the three tethers [m] Default: zeros(S, 3)\npsi::Any: azimuth angle in radian; inital value is zero Default: zero(S)\nt_0::Any: relative start time of the current time interval Default: 0.0\nreel_out_speeds::Any: reel out speed of the winch Default: zeros(S, 3)\ntether_lengths::Any: unstretched tether length Default: zeros(S, 3)\nsteering_pos::StaticArraysCore.MVector{2}: lengths of the connections of the steering tethers to the kite Default: zeros(S, 2)\nrho::Any: air density at the height of the kite Default: 0.0\nstiffness_factor::Any: multiplier for the stiffniss of tether and bridle Default: 1.0\nmasses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: zeros(P)\nsprings::StaticArraysCore.MVector: vector of the springs, defined as struct Default: zeros(SP, Q)\nforces::StaticArraysCore.SVector{P, T} where {T, P}: vector of the forces, acting on the particles Default: zeros(SVector{P, T})\nset_values::StaticArraysCore.MVector{3, Float64}: synchronous speed or torque of the motor/ generator Default: zeros(KVec3)\ntorque_control::Bool: whether or not to use torque control instead of speed control Default: false\ne_x::Any: x vector of kite reference frame Default: zeros(S, 3)\ne_y::Any: y vector of kite reference frame Default: zeros(S, 3)\ne_z::Any: z vector of kite reference frame Default: zeros(S, 3)\nnum_E::Int64: Point number of E Default: 0\nnum_C::Int64: Point number of C Default: 0\nnum_D::Int64: Point number of D Default: 0\nnum_A::Int64: Point number of A Default: 0\nα_l::Float64: Angle of right tip Default: 0.0\nα_r::Float64: Angle of left tip Default: 0.0\nL_C::Any: Lift of point C Default: zeros(S, 3)\nL_D::Any: Lift of point D Default: zeros(S, 3)\nD_C::Any: Drag of point C Default: zeros(S, 3)\nD_D::Any: Drag of point D Default: zeros(S, 3)\nsteady_sol::Union{Nothing, SciMLBase.NonlinearSolution}: Solution of the steady state problem Default: nothing\nsimple_sys::Union{Nothing, ModelingToolkit.ODESystem}: Simplified system of the mtk model Default: nothing\nset_values_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing\nv_wind_gnd_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing\nstiffness_factor_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing\nv_wind_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing\nprob::Union{Nothing, SciMLBase.ODEProblem}: Default: nothing\nget_pos::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_steering_pos::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_line_acc::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_kite_vel::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_winch_forces::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_tether_lengths::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_tether_speeds::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_L_C::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_L_D::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_D_C::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\nget_D_D::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing\n\n\n\n\n\n","category":"type"},{"location":"types/","page":"Types","title":"Types","text":"These structs store the state of the one point model and four point model. Only in unit tests it is allowed to access the members directly, otherwise use the input and output functions. The model KPS4_3L is not yet implemented, it is just a copy of KPS4.","category":"page"}] } diff --git a/dev/types/index.html b/dev/types/index.html index 9f8a7ffd..a2ce187a 100644 --- a/dev/types/index.html +++ b/dev/types/index.html @@ -1,2 +1,2 @@ -Types · KiteModels.jl

      Exported Types

      Basic types

      KiteModels.SimFloatType
      const SimFloat = Float64

      This type is used for all real variables, used in the Simulation. Possible alternatives: Float32, Double64, Dual Other types than Float64 or Float32 do require support of Julia types by the solver.

      source
      KiteModels.KVec3Type

      const KVec3 = MVector{3, SimFloat}

      Basic 3-dimensional vector, stack allocated, mutable.

      source
      KiteModels.SVec3Type

      const SVec3 = SVector{3, SimFloat}

      Basic 3-dimensional vector, stack allocated, immutable.

      source
      KiteModels.AbstractKiteModelType
      abstract type AbstractKiteModel

      All kite models must inherit from this type. All methods that are defined on this type must work with all kite models. All exported methods must work on this type.

      source

      Struct KPS3 and KPS4 and KPS4_3L

      KiteModels.KPS3Type
      mutable struct KPS3{S, T, P} <: AbstractKiteModel

      State of the kite power system. Parameters:

      • S: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.
      • T: Vector type, e.g. MVector{3, SimFloat}
      • P: number of points of the system, segments+1

      Normally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.

      • set::Settings: Reference to the settings struct

      • kcu::KCU: Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels

      • am::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()

      • wm::Union{Nothing, AbstractWinchModel}: Reference to winch model as implemented in the package WinchModels Default: nothing

      • iter::Int64: Iterations, number of calls to the function residual! Default: 0

      • calc_cl::Dierckx.Spline1D: Function for calculation the lift coefficent, using a spline based on the provided value pairs.

      • calc_cd::Dierckx.Spline1D: Function for calculation the drag coefficent, using a spline based on the provided value pairs.

      • v_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)

      • v_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)

      • v_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)

      • v_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)

      • v_app_perp::Any: vector, perpendicular to vapparent; output of calcdrag Default: zeros(S, 3)

      • drag_force::Any: drag force of kite and bridle; output of calcaeroforces Default: zeros(S, 3)

      • lift_force::Any: lift force of the kite; output of calcaeroforces Default: zeros(S, 3)

      • steering_force::Any: steering force acting on the kite; output of calcaeroforces Default: zeros(S, 3)

      • last_force::Any: Default: zeros(S, 3)

      • spring_force::Any: spring force of the current tether segment, output of calc_res Default: zeros(S, 3)

      • total_forces::Any: Default: zeros(S, 3)

      • force::Any: sum of spring and drag forces acting on the current segment, output of calc_res Default: zeros(S, 3)

      • unit_vector::Any: unit vector in the direction of the current tether segment, output of calc_res Default: zeros(S, 3)

      • av_vel::Any: average velocity of the current tether segment, output of calc_res Default: zeros(S, 3)

      • kite_y::Any: y-vector of the kite fixed referense frame, output of calcaeroforces Default: zeros(S, 3)

      • segment::Any: vector representing one tether segment (p1-p2) Default: zeros(S, 3)

      • last_tether_drag::Any: vector of the drag force of the last calculated tether segment Default: zeros(S, 3)

      • vec_z::Any: z vector of the kite reference frame Default: zeros(S, 3)

      • res1::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: part one of the residual, difference between pos' and vel, non-flat, mainly for unit testing Default: zeros(SVector{P, KVec3})

      • res2::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: part two of the residual, difference between vel' and acc, non-flat, mainly for unit testing Default: zeros(SVector{P, KVec3})

      • pos::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the positions of the particles Default: zeros(SVector{P, KVec3})

      • vel_kite::Any: velocity vector of the kite Default: zeros(S, 3)

      • seg_area::Any: area of one tether segment [m²] Default: zero(S)

      • bridle_area::Any: total actual bridle area [m²] Default: zero(S)

      • c_spring::Any: spring constant, depending on the length of the tether segment Default: zero(S)

      • segment_length::Any: unstressed segment length [m] Default: 0.0

      • damping::Any: damping factor, depending on the length of the tether segment Default: zero(S)

      • last_v_app_norm_tether::Any: last norm of the apparent wind speed at a tether segment [m/s] Default: zero(S)

      • param_cl::Any: lift coefficient of the kite, depending on the angle of attack Default: 0.2

      • param_cd::Any: drag coefficient of the kite, depending on the angle of attack Default: 1.0

      • cor_steering::Any: correction term for the steering, in paper named i_(s,c), Eq. 30 Default: zero(S)

      • psi::Any: azimuth angle in radian; inital value is zero Default: zero(S)

      • beta::Any: elevation angle in radian; initial value about 70 degrees Default: deg2rad((se()).elevation)

      • alpha_depower::Any: depower angle [deg] Default: 0.0

      • t_0::Any: relative start time of the current time interval Default: 0.0

      • v_reel_out::Any: reel out speed of the winch [m/s] Default: 0.0

      • last_v_reel_out::Any: reel out speed during the last time step Default: 0.0

      • l_tether::Any: unstretched tether length Default: 0.0

      • rho::Any: air density at the height of the kite Default: 0.0

      • depower::Any: actual relative depower setting, must be between 0 .. 1.0 Default: 0.0

      • steering::Any: actual relative steering setting, must be between -1.0 .. 1.0 Default: 0.0

      • stiffness_factor::Any: factor for the tether stiffness, used to find the steady state with a low stiffness first Default: 1.0

      • initial_masses::StaticArraysCore.MVector{P, S} where {S, P}: initial masses of the point masses Default: ones(P)

      • masses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: ones(P)

      • forces::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the forces, acting on the particles Default: zeros(SVector{P, KVec3})

      • sync_speed::Union{Nothing, S} where S: synchronous speed of the motor/ generator Default: 0.0

      • set_torque::Union{Nothing, S} where S: set_torque of the motor/generator Default: nothing

      source
      KiteModels.KPS4Type
      mutable struct KPS4{S, T, P, Q, SP} <: AbstractKiteModel

      State of the kite power system, using a 4 point kite model. Parameters:

      • S: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.
      • T: Vector type, e.g. MVector{3, SimFloat}
      • P: number of points of the system, segments+1
      • Q: number of springs in the system, P-1
      • SP: struct type, describing a spring

      Normally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.

      • set::Settings: Reference to the settings struct

      • kcu::KCU: Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels

      • am::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()

      • wm::AbstractWinchModel: Reference to winch model as implemented in the package WinchModels

      • iter::Int64: Iterations, number of calls to the function residual! Default: 0

      • calc_cl::Dierckx.Spline1D: Function for calculation the lift coefficent, using a spline based on the provided value pairs.

      • calc_cd::Dierckx.Spline1D: Function for calculation the drag coefficent, using a spline based on the provided value pairs.

      • v_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)

      • v_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)

      • v_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)

      • v_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)

      • bridle_factor::Any: bridlefactor = set.lbridle/bridle_length(set) Default: 1.0

      • side_cl::Any: side lift coefficient, the difference of the left and right lift coeficients Default: 0.0

      • drag_force::Any: drag force of kite and bridle; output of calcaeroforces! Default: zeros(S, 3)

      • side_force::Any: side_force acting on the kite Default: zeros(S, 3)

      • ks::Any: max_steering angle in radian Default: 0.0

      • lift_force::Any: lift force of the kite; output of calcaeroforces! Default: zeros(S, 3)

      • spring_force::Any: spring force of the current tether segment, output of calcparticleforces! Default: zeros(S, 3)

      • last_force::Any: last winch force Default: zeros(S, 3)

      • res1::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the residual one (pos,vel) for debugging and unit tests Default: zeros(SVector{P, KVec3})

      • res2::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the residual two (vel,acc) for debugging and unit tests Default: zeros(SVector{P, KVec3})

      • pos::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the actual positions as output for the user Default: zeros(SVector{P, KVec3})

      • vel_kite::Any: velocity vector of the kite Default: zeros(S, 3)

      • segment_length::Any: unstressed segment length [m] Default: 0.0

      • param_cl::Any: lift coefficient of the kite, depending on the angle of attack Default: 0.2

      • param_cd::Any: drag coefficient of the kite, depending on the angle of attack Default: 1.0

      • psi::Any: azimuth angle in radian; inital value is zero Default: zero(S)

      • alpha_depower::Any: depower angle [deg] Default: 0.0

      • alpha_2::Any: aoa at paricle B Default: 0.0

      • alpha_2b::Any: aoa at paricle B, corrected formula Default: 0.0

      • alpha_3::Any: aoa at paricle C Default: 0.0

      • alpha_3b::Any: Default: 0.0

      • alpha_4::Any: aoa at paricle D Default: 0.0

      • alpha_4b::Any: Default: 0.0

      • t_0::Any: relative start time of the current time interval Default: 0.0

      • v_reel_out::Any: reel out speed of the winch Default: 0.0

      • last_v_reel_out::Any: reel out speed at the last time step Default: 0.0

      • l_tether::Any: unstretched tether length Default: 0.0

      • rho::Any: air density at the height of the kite Default: 0.0

      • depower::Any: actual relative depower setting, must be between 0 .. 1.0 Default: 0.0

      • steering::Any: actual relative steering setting, must be between -1.0 .. 1.0 Default: 0.0

      • stiffness_factor::Any: multiplier for the stiffniss of tether and bridle Default: 1.0

      • initial_masses::StaticArraysCore.MVector{P, S} where {S, P}: initial masses of the point masses Default: ones(P)

      • masses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: zeros(P)

      • springs::StaticArraysCore.MVector: vector of the springs, defined as struct Default: zeros(SP, Q)

      • forces::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the forces, acting on the particles Default: zeros(SVector{P, KVec3})

      • sync_speed::Union{Nothing, S} where S: synchronous speed of the motor/ generator Default: 0.0

      • set_torque::Union{Nothing, S} where S: set_torque of the motor/generator Default: nothing

      • x::Any: x vector of kite reference frame Default: zeros(S, 3)

      • y::Any: y vector of kite reference frame Default: zeros(S, 3)

      • z::Any: z vector of kite reference frame Default: zeros(S, 3)

      source
      KiteModels.KPS4_3LType
      mutable struct KPS4_3L{S, T, P, Q, SP} <: AbstractKiteModel

      State of the kite power system, using a 3 point kite model and three steering lines to the ground. Parameters:

      • S: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.
      • T: Vector type, e.g. MVector{3, SimFloat}
      • P: number of points of the system, segments+3
      • Q: number of springs in the system, P-1
      • SP: struct type, describing a spring

      Normally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.

      • set::Settings: Reference to the settings struct

      • set_hash::UInt64: Reference to the settings hash Default: 0

      • last_init_elevation::Float64: The last initial elevation Default: 0.0

      • last_init_tether_length::Float64: The last initial tether length Default: 0.0

      • last_set_hash::UInt64: Reference to the last settings hash Default: 0

      • am::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()

      • calc_cl::Any: Function for calculation the lift coefficent, using a spline based on the provided value pairs. Default: Spline1D((se()).alphacl, (se()).cllist)

      • calc_cd::Any: Function for calculation the drag coefficent, using a spline based on the provided value pairs. Default: Spline1D((se()).alphacd, (se()).cdlist)

      • motors::StaticArraysCore.SVector{3, AbstractWinchModel}: Reference to the motor models as implemented in the package WinchModels. index 1: middle motor, index 2: left motor, index 3: right motor

      • iter::Int64: Iterations, number of calls to the function residual! Default: 0

      • v_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)

      • v_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)

      • v_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)

      • v_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)

      • winch_forces::StaticArraysCore.SVector{3}: last winch force Default: [zeros(S, 3) for _ = 1:3]

      • res1::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the residual one (pos,vel) for debugging and unit tests Default: zeros(SVector{P, T})

      • res2::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the residual two (vel,acc) for debugging and unit tests Default: zeros(SVector{P, T})

      • pos::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the actual positions as output for the user Default: zeros(SVector{P, T})

      • vel::StaticArraysCore.SVector{P, T} where {T, P}: Default: zeros(SVector{P, T})

      • veld::StaticArraysCore.SVector{P, T} where {T, P}: Default: zeros(SVector{P, T})

      • vel_kite::Any: velocity vector of the kite Default: zeros(S, 3)

      • segment_lengths::Any: unstressed segment lengths of the three tethers [m] Default: zeros(S, 3)

      • psi::Any: azimuth angle in radian; inital value is zero Default: zero(S)

      • t_0::Any: relative start time of the current time interval Default: 0.0

      • reel_out_speeds::Any: reel out speed of the winch Default: zeros(S, 3)

      • tether_lengths::Any: unstretched tether length Default: zeros(S, 3)

      • steering_pos::StaticArraysCore.MVector{2}: lengths of the connections of the steering tethers to the kite Default: zeros(S, 2)

      • rho::Any: air density at the height of the kite Default: 0.0

      • stiffness_factor::Any: multiplier for the stiffniss of tether and bridle Default: 1.0

      • masses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: zeros(P)

      • springs::StaticArraysCore.MVector: vector of the springs, defined as struct Default: zeros(SP, Q)

      • forces::StaticArraysCore.SVector{P, T} where {T, P}: vector of the forces, acting on the particles Default: zeros(SVector{P, T})

      • set_values::StaticArraysCore.MVector{3, Float64}: synchronous speed or torque of the motor/ generator Default: zeros(KVec3)

      • torque_control::Bool: whether or not to use torque control instead of speed control Default: false

      • e_x::Any: x vector of kite reference frame Default: zeros(S, 3)

      • e_y::Any: y vector of kite reference frame Default: zeros(S, 3)

      • e_z::Any: z vector of kite reference frame Default: zeros(S, 3)

      • num_E::Int64: Point number of E Default: 0

      • num_C::Int64: Point number of C Default: 0

      • num_D::Int64: Point number of D Default: 0

      • num_A::Int64: Point number of A Default: 0

      • α_l::Float64: Angle of right tip Default: 0.0

      • α_r::Float64: Angle of left tip Default: 0.0

      • L_C::Any: Lift of point C Default: zeros(S, 3)

      • L_D::Any: Lift of point D Default: zeros(S, 3)

      • D_C::Any: Drag of point C Default: zeros(S, 3)

      • D_D::Any: Drag of point D Default: zeros(S, 3)

      • steady_sol::Union{Nothing, SciMLBase.NonlinearSolution}: Solution of the steady state problem Default: nothing

      • simple_sys::Union{Nothing, ModelingToolkit.ODESystem}: Simplified system of the mtk model Default: nothing

      • set_values_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing

      • v_wind_gnd_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing

      • stiffness_factor_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing

      • v_wind_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing

      • prob::Union{Nothing, SciMLBase.ODEProblem}: Default: nothing

      • get_pos::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_steering_pos::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_line_acc::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_kite_vel::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_winch_forces::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_tether_lengths::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_tether_speeds::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_L_C::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_L_D::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_D_C::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_D_D::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      source

      These structs store the state of the one point model and four point model. Only in unit tests it is allowed to access the members directly, otherwise use the input and output functions. The model KPS4_3L is not yet implemented, it is just a copy of KPS4.

      +Types · KiteModels.jl

      Exported Types

      Basic types

      KiteModels.SimFloatType
      const SimFloat = Float64

      This type is used for all real variables, used in the Simulation. Possible alternatives: Float32, Double64, Dual Other types than Float64 or Float32 do require support of Julia types by the solver.

      source
      KiteModels.KVec3Type

      const KVec3 = MVector{3, SimFloat}

      Basic 3-dimensional vector, stack allocated, mutable.

      source
      KiteModels.SVec3Type

      const SVec3 = SVector{3, SimFloat}

      Basic 3-dimensional vector, stack allocated, immutable.

      source
      KiteModels.AbstractKiteModelType
      abstract type AbstractKiteModel

      All kite models must inherit from this type. All methods that are defined on this type must work with all kite models. All exported methods must work on this type.

      source

      Struct KPS3 and KPS4 and KPS4_3L

      KiteModels.KPS3Type
      mutable struct KPS3{S, T, P} <: AbstractKiteModel

      State of the kite power system. Parameters:

      • S: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.
      • T: Vector type, e.g. MVector{3, SimFloat}
      • P: number of points of the system, segments+1

      Normally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.

      • set::Settings: Reference to the settings struct

      • kcu::KCU: Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels

      • am::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()

      • wm::Union{Nothing, AbstractWinchModel}: Reference to winch model as implemented in the package WinchModels Default: nothing

      • iter::Int64: Iterations, number of calls to the function residual! Default: 0

      • calc_cl::Dierckx.Spline1D: Function for calculation the lift coefficent, using a spline based on the provided value pairs.

      • calc_cd::Dierckx.Spline1D: Function for calculation the drag coefficent, using a spline based on the provided value pairs.

      • v_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)

      • v_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)

      • v_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)

      • v_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)

      • v_app_perp::Any: vector, perpendicular to vapparent; output of calcdrag Default: zeros(S, 3)

      • drag_force::Any: drag force of kite and bridle; output of calcaeroforces Default: zeros(S, 3)

      • lift_force::Any: lift force of the kite; output of calcaeroforces Default: zeros(S, 3)

      • steering_force::Any: steering force acting on the kite; output of calcaeroforces Default: zeros(S, 3)

      • last_force::Any: Default: zeros(S, 3)

      • spring_force::Any: spring force of the current tether segment, output of calc_res Default: zeros(S, 3)

      • total_forces::Any: Default: zeros(S, 3)

      • force::Any: sum of spring and drag forces acting on the current segment, output of calc_res Default: zeros(S, 3)

      • unit_vector::Any: unit vector in the direction of the current tether segment, output of calc_res Default: zeros(S, 3)

      • av_vel::Any: average velocity of the current tether segment, output of calc_res Default: zeros(S, 3)

      • kite_y::Any: y-vector of the kite fixed referense frame, output of calcaeroforces Default: zeros(S, 3)

      • segment::Any: vector representing one tether segment (p1-p2) Default: zeros(S, 3)

      • last_tether_drag::Any: vector of the drag force of the last calculated tether segment Default: zeros(S, 3)

      • vec_z::Any: z vector of the kite reference frame Default: zeros(S, 3)

      • res1::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: part one of the residual, difference between pos' and vel, non-flat, mainly for unit testing Default: zeros(SVector{P, KVec3})

      • res2::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: part two of the residual, difference between vel' and acc, non-flat, mainly for unit testing Default: zeros(SVector{P, KVec3})

      • pos::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the positions of the particles Default: zeros(SVector{P, KVec3})

      • vel_kite::Any: velocity vector of the kite Default: zeros(S, 3)

      • seg_area::Any: area of one tether segment [m²] Default: zero(S)

      • bridle_area::Any: total actual bridle area [m²] Default: zero(S)

      • c_spring::Any: spring constant, depending on the length of the tether segment Default: zero(S)

      • segment_length::Any: unstressed segment length [m] Default: 0.0

      • damping::Any: damping factor, depending on the length of the tether segment Default: zero(S)

      • last_v_app_norm_tether::Any: last norm of the apparent wind speed at a tether segment [m/s] Default: zero(S)

      • param_cl::Any: lift coefficient of the kite, depending on the angle of attack Default: 0.2

      • param_cd::Any: drag coefficient of the kite, depending on the angle of attack Default: 1.0

      • cor_steering::Any: correction term for the steering, in paper named i_(s,c), Eq. 30 Default: zero(S)

      • psi::Any: azimuth angle in radian; inital value is zero Default: zero(S)

      • beta::Any: elevation angle in radian; initial value about 70 degrees Default: deg2rad((se()).elevation)

      • alpha_depower::Any: depower angle [deg] Default: 0.0

      • t_0::Any: relative start time of the current time interval Default: 0.0

      • v_reel_out::Any: reel out speed of the winch [m/s] Default: 0.0

      • last_v_reel_out::Any: reel out speed during the last time step Default: 0.0

      • l_tether::Any: unstretched tether length Default: 0.0

      • rho::Any: air density at the height of the kite Default: 0.0

      • depower::Any: actual relative depower setting, must be between 0 .. 1.0 Default: 0.0

      • steering::Any: actual relative steering setting, must be between -1.0 .. 1.0 Default: 0.0

      • stiffness_factor::Any: factor for the tether stiffness, used to find the steady state with a low stiffness first Default: 1.0

      • initial_masses::StaticArraysCore.MVector{P, S} where {S, P}: initial masses of the point masses Default: ones(P)

      • masses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: ones(P)

      • forces::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the forces, acting on the particles Default: zeros(SVector{P, KVec3})

      • sync_speed::Union{Nothing, S} where S: synchronous speed of the motor/ generator Default: 0.0

      • set_torque::Union{Nothing, S} where S: set_torque of the motor/generator Default: nothing

      source
      KiteModels.KPS4Type
      mutable struct KPS4{S, T, P, Q, SP} <: AbstractKiteModel

      State of the kite power system, using a 4 point kite model. Parameters:

      • S: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.
      • T: Vector type, e.g. MVector{3, SimFloat}
      • P: number of points of the system, segments+1
      • Q: number of springs in the system, P-1
      • SP: struct type, describing a spring

      Normally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.

      • set::Settings: Reference to the settings struct

      • kcu::KCU: Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels

      • am::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()

      • wm::AbstractWinchModel: Reference to winch model as implemented in the package WinchModels

      • iter::Int64: Iterations, number of calls to the function residual! Default: 0

      • calc_cl::Dierckx.Spline1D: Function for calculation the lift coefficent, using a spline based on the provided value pairs.

      • calc_cd::Dierckx.Spline1D: Function for calculation the drag coefficent, using a spline based on the provided value pairs.

      • v_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)

      • v_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)

      • v_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)

      • v_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)

      • bridle_factor::Any: bridlefactor = set.lbridle/bridle_length(set) Default: 1.0

      • side_cl::Any: side lift coefficient, the difference of the left and right lift coeficients Default: 0.0

      • drag_force::Any: drag force of kite and bridle; output of calcaeroforces! Default: zeros(S, 3)

      • side_force::Any: side_force acting on the kite Default: zeros(S, 3)

      • ks::Any: max_steering angle in radian Default: 0.0

      • lift_force::Any: lift force of the kite; output of calcaeroforces! Default: zeros(S, 3)

      • spring_force::Any: spring force of the current tether segment, output of calcparticleforces! Default: zeros(S, 3)

      • last_force::Any: last winch force Default: zeros(S, 3)

      • res1::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the residual one (pos,vel) for debugging and unit tests Default: zeros(SVector{P, KVec3})

      • res2::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the residual two (vel,acc) for debugging and unit tests Default: zeros(SVector{P, KVec3})

      • pos::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: a copy of the actual positions as output for the user Default: zeros(SVector{P, KVec3})

      • vel_kite::Any: velocity vector of the kite Default: zeros(S, 3)

      • segment_length::Any: unstressed segment length [m] Default: 0.0

      • param_cl::Any: lift coefficient of the kite, depending on the angle of attack Default: 0.2

      • param_cd::Any: drag coefficient of the kite, depending on the angle of attack Default: 1.0

      • psi::Any: azimuth angle in radian; inital value is zero Default: zero(S)

      • alpha_depower::Any: depower angle [deg] Default: 0.0

      • alpha_2::Any: aoa at paricle B Default: 0.0

      • alpha_2b::Any: aoa at paricle B, corrected formula Default: 0.0

      • alpha_3::Any: aoa at paricle C Default: 0.0

      • alpha_3b::Any: Default: 0.0

      • alpha_4::Any: aoa at paricle D Default: 0.0

      • alpha_4b::Any: Default: 0.0

      • t_0::Any: relative start time of the current time interval Default: 0.0

      • v_reel_out::Any: reel out speed of the winch Default: 0.0

      • last_v_reel_out::Any: reel out speed at the last time step Default: 0.0

      • l_tether::Any: unstretched tether length Default: 0.0

      • rho::Any: air density at the height of the kite Default: 0.0

      • depower::Any: actual relative depower setting, must be between 0 .. 1.0 Default: 0.0

      • steering::Any: actual relative steering setting, must be between -1.0 .. 1.0 Default: 0.0

      • stiffness_factor::Any: multiplier for the stiffniss of tether and bridle Default: 1.0

      • initial_masses::StaticArraysCore.MVector{P, S} where {S, P}: initial masses of the point masses Default: ones(P)

      • masses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: zeros(P)

      • springs::StaticArraysCore.MVector: vector of the springs, defined as struct Default: zeros(SP, Q)

      • forces::StaticArraysCore.SVector{P, StaticArraysCore.MVector{3, Float64}} where P: vector of the forces, acting on the particles Default: zeros(SVector{P, KVec3})

      • sync_speed::Union{Nothing, S} where S: synchronous speed of the motor/ generator Default: 0.0

      • set_torque::Union{Nothing, S} where S: set_torque of the motor/generator Default: nothing

      • x::Any: x vector of kite reference frame Default: zeros(S, 3)

      • y::Any: y vector of kite reference frame Default: zeros(S, 3)

      • z::Any: z vector of kite reference frame Default: zeros(S, 3)

      source
      KiteModels.KPS4_3LType
      mutable struct KPS4_3L{S, T, P, Q, SP} <: AbstractKiteModel

      State of the kite power system, using a 3 point kite model and three steering lines to the ground. Parameters:

      • S: Scalar type, e.g. SimFloat In the documentation mentioned as Any, but when used in this module it is always SimFloat and not Any.
      • T: Vector type, e.g. MVector{3, SimFloat}
      • P: number of points of the system, segments+3
      • Q: number of springs in the system, P-1
      • SP: struct type, describing a spring

      Normally a user of this package will not have to access any of the members of this type directly, use the input and output functions instead.

      • set::Settings: Reference to the settings struct

      • set_hash::UInt64: Reference to the settings hash Default: 0

      • last_init_elevation::Float64: The last initial elevation Default: 0.0

      • last_init_tether_length::Float64: The last initial tether length Default: 0.0

      • last_set_hash::UInt64: Reference to the last settings hash Default: 0

      • am::AtmosphericModel: Reference to the atmospheric model as implemented in the package AtmosphericModels Default: AtmosphericModel()

      • calc_cl::Any: Function for calculation the lift coefficent, using a spline based on the provided value pairs. Default: Spline1D((se()).alphacl, (se()).cllist)

      • calc_cd::Any: Function for calculation the drag coefficent, using a spline based on the provided value pairs. Default: Spline1D((se()).alphacd, (se()).cdlist)

      • motors::StaticArraysCore.SVector{3, AbstractWinchModel}: Reference to the motor models as implemented in the package WinchModels. index 1: middle motor, index 2: left motor, index 3: right motor

      • iter::Int64: Iterations, number of calls to the function residual! Default: 0

      • v_wind::Any: wind vector at the height of the kite Default: zeros(S, 3)

      • v_wind_gnd::Any: wind vector at reference height Default: zeros(S, 3)

      • v_wind_tether::Any: wind vector used for the calculation of the tether drag Default: zeros(S, 3)

      • v_apparent::Any: apparent wind vector at the kite Default: zeros(S, 3)

      • winch_forces::StaticArraysCore.SVector{3}: last winch force Default: [zeros(S, 3) for _ = 1:3]

      • res1::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the residual one (pos,vel) for debugging and unit tests Default: zeros(SVector{P, T})

      • res2::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the residual two (vel,acc) for debugging and unit tests Default: zeros(SVector{P, T})

      • pos::StaticArraysCore.SVector{P, T} where {T, P}: a copy of the actual positions as output for the user Default: zeros(SVector{P, T})

      • vel::StaticArraysCore.SVector{P, T} where {T, P}: Default: zeros(SVector{P, T})

      • veld::StaticArraysCore.SVector{P, T} where {T, P}: Default: zeros(SVector{P, T})

      • vel_kite::Any: velocity vector of the kite Default: zeros(S, 3)

      • segment_lengths::Any: unstressed segment lengths of the three tethers [m] Default: zeros(S, 3)

      • psi::Any: azimuth angle in radian; inital value is zero Default: zero(S)

      • t_0::Any: relative start time of the current time interval Default: 0.0

      • reel_out_speeds::Any: reel out speed of the winch Default: zeros(S, 3)

      • tether_lengths::Any: unstretched tether length Default: zeros(S, 3)

      • steering_pos::StaticArraysCore.MVector{2}: lengths of the connections of the steering tethers to the kite Default: zeros(S, 2)

      • rho::Any: air density at the height of the kite Default: 0.0

      • stiffness_factor::Any: multiplier for the stiffniss of tether and bridle Default: 1.0

      • masses::StaticArraysCore.MVector{P, S} where {S, P}: current masses, depending on the total tether length Default: zeros(P)

      • springs::StaticArraysCore.MVector: vector of the springs, defined as struct Default: zeros(SP, Q)

      • forces::StaticArraysCore.SVector{P, T} where {T, P}: vector of the forces, acting on the particles Default: zeros(SVector{P, T})

      • set_values::StaticArraysCore.MVector{3, Float64}: synchronous speed or torque of the motor/ generator Default: zeros(KVec3)

      • torque_control::Bool: whether or not to use torque control instead of speed control Default: false

      • e_x::Any: x vector of kite reference frame Default: zeros(S, 3)

      • e_y::Any: y vector of kite reference frame Default: zeros(S, 3)

      • e_z::Any: z vector of kite reference frame Default: zeros(S, 3)

      • num_E::Int64: Point number of E Default: 0

      • num_C::Int64: Point number of C Default: 0

      • num_D::Int64: Point number of D Default: 0

      • num_A::Int64: Point number of A Default: 0

      • α_l::Float64: Angle of right tip Default: 0.0

      • α_r::Float64: Angle of left tip Default: 0.0

      • L_C::Any: Lift of point C Default: zeros(S, 3)

      • L_D::Any: Lift of point D Default: zeros(S, 3)

      • D_C::Any: Drag of point C Default: zeros(S, 3)

      • D_D::Any: Drag of point D Default: zeros(S, 3)

      • steady_sol::Union{Nothing, SciMLBase.NonlinearSolution}: Solution of the steady state problem Default: nothing

      • simple_sys::Union{Nothing, ModelingToolkit.ODESystem}: Simplified system of the mtk model Default: nothing

      • set_values_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing

      • v_wind_gnd_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing

      • stiffness_factor_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing

      • v_wind_idx::Union{Nothing, ModelingToolkit.ParameterIndex}: Default: nothing

      • prob::Union{Nothing, SciMLBase.ODEProblem}: Default: nothing

      • get_pos::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_steering_pos::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_line_acc::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_kite_vel::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_winch_forces::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_tether_lengths::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_tether_speeds::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_L_C::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_L_D::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_D_C::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      • get_D_D::Union{Nothing, SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction}: Default: nothing

      source

      These structs store the state of the one point model and four point model. Only in unit tests it is allowed to access the members directly, otherwise use the input and output functions. The model KPS4_3L is not yet implemented, it is just a copy of KPS4.