Skip to content

Get the correct AoA from VSM #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Sundials = "4.24"
SymbolicIndexingInterface = "0"
Timers = "0.1.5"
UnPack = "1.0.2"
VortexStepMethod = "1.2.2"
VortexStepMethod = "1.2.3"
WinchModels = "0.3.6"
julia = "1.10, 1.11"

Expand Down
5 changes: 1 addition & 4 deletions examples/ram_air_kite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ try
sys_state.var_13 = s.integrator[sys.pulley_l0[1]]
sys_state.var_14 = s.integrator[sys.pulley_l0[2]]

# Calculate apparent wind angle
va_kite_b = s.integrator[sys.va_kite_b]
e_x = s.integrator[sys.e_x]
sys_state.var_15 = rad2deg(acos(dot(normalize(va_kite_b), e_x)))
sys_state.var_15 = rad2deg(calc_aoa(s))

log!(logger, sys_state)
end
Expand Down
2 changes: 1 addition & 1 deletion src/KiteModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export KPS3, KPS4, RamAirKite, KVec3, SimFloat, Measurement, PointMassSystem, Pr
export calc_set_cl_cd!, copy_examples, copy_bin, update_sys_state! # helper functions
export clear!, find_steady_state!, residual! # low level workers
export init_sim!, init!, reinit!, next_step!, init_pos_vel, init_pos, model! # high level workers
export pos_kite, calc_height, calc_elevation, calc_azimuth, calc_heading, calc_course, calc_orient_quat # getters
export pos_kite, calc_height, calc_elevation, calc_azimuth, calc_heading, calc_course, calc_orient_quat, calc_aoa # getters
export calc_azimuth_north, calc_azimuth_east
export winch_force, lift_drag, cl_cd, lift_over_drag, unstretched_length, tether_length, v_wind_kite # getters
export calculate_rotational_inertia!
Expand Down
12 changes: 12 additions & 0 deletions src/ram_air_kite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -541,3 +541,15 @@ function get_prob_name(set::Settings)
end
end

"""
Calculate and return the angle of attack in rad
"""
function calc_aoa(s::RamAirKite)
alpha_array = s.vsm_solver.sol.alpha_array
middle = length(alpha_array) ÷ 2
if iseven(length(alpha_array))
return 0.5alpha_array[middle] + 0.5alpha_array[middle+1]
else
return alpha_array[middle+1]
end
end
Loading