Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Fechner committed Jul 8, 2024
1 parent 8a31012 commit e0f9f72
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions examples/depower.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ using KiteViewers, KiteModels, KitePodModels, Rotations
# example program that shows
# a. how to create a video
# b. how to create a performance plot (simulation speed vs time)
const Model = KPS4

if ! @isdefined kcu; const kcu = KCU(se()); end
if ! @isdefined kps4; const kps4 = Model(kcu); end
kcu::KCU = KCU(se())
kps4::KPS4 = KPS4(kcu)

# the following values can be changed to match your interest
dt::Float64 = 0.05
TIME = 40
TIME = 60
TIME_LAPSE_RATIO = 5
STEPS = Int64(round(TIME/dt))
STATISTIC = false
Expand All @@ -25,8 +24,6 @@ SAVE_PNG = false
PLOT_PERFORMANCE = false
# end of user parameter section #

if Model==KPS3 SHOW_KITE = true end

if ! @isdefined time_vec; const time_vec = zeros(div(STEPS, TIME_LAPSE_RATIO)); end
viewer::Viewer3D = Viewer3D(SHOW_KITE)

Expand Down Expand Up @@ -67,7 +64,7 @@ function simulate(integrator, steps; log=false)
(integrator.p.iter - start) / steps
end

integrator = KiteModels.init_sim!(kps4, stiffness_factor=0.04, prn=STATISTIC)
integrator = KiteModels.init_sim!(kps4, stiffness_factor=0.5, prn=STATISTIC)

av_steps = simulate(integrator, STEPS, log=SAVE_PNG)
if PLOT_PERFORMANCE
Expand Down

0 comments on commit e0f9f72

Please sign in to comment.