Skip to content

Commit

Permalink
modify the code by using multiple dispatch for running this test code…
Browse files Browse the repository at this point in the history
… without modification & add the test code considering wind force
  • Loading branch information
hinata235 committed Jun 19, 2024
1 parent a2ef738 commit 97cc7f3
Show file tree
Hide file tree
Showing 7 changed files with 1,473 additions and 255 deletions.
13 changes: 12 additions & 1 deletion src/ShipMMG.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using ForwardDiff
include("data.jl")
export calc_position,
ShipData,
ShipDataAdvanced,
get_KVLCC2_L7_basic_params,
get_KVLCC2_L7_maneuvering_params,
get_KVLCC2_L7_params,
Expand All @@ -27,12 +28,22 @@ export kt_simulate,
create_model_for_mcmc_sample_kt

include("mmg.jl")
export Mmg3DofBasicParams,
Mmg3DofManeuveringParams,
mmg_3dof_simulate,
mmg_3dof_model!,
mmg_3dof_zigzag_test,
estimate_mmg_approx_lsm,
estimate_mmg_approx_lsm_time_window_sampling,
create_model_for_mcmc_sample_mmg

include("mmg_wind.jl")
export Mmg3DofBasicParams,
Mmg3DofManeuveringParams,
Mmg3DofWindForceMomentParams,
apparent_wind_speed_and_angle,
mmg_3dof_simulate,
mmg_3dof_model!,
mmg_3dof_model_adbanced!,
mmg_3dof_zigzag_test,
estimate_mmg_approx_lsm,
estimate_mmg_approx_lsm_time_window_sampling,
Expand Down
18 changes: 15 additions & 3 deletions src/data.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@with_kw struct ShipData{Tt,Tu,Tv,Tr,Tx,Ty,Tψ,Tδ,Tn_p,TU_w,Tψ_w}
@with_kw struct ShipData{Tt,Tu,Tv,Tr,Tx,Ty,Tψ,Tδ,Tn_p}
time::Tt
u::Tu
v::Tv
Expand All @@ -8,8 +8,20 @@
ψ::Tψ
δ::Tδ
n_p::Tn_p
U_W::TU_w
ψ_W::Tψ_w
end

@with_kw struct ShipDataAdvanced{Tt,Tu,Tv,Tr,Tx,Ty,Tψ,Tδ,Tn_p,TU_W,Tψ_W}
time::Tt
u::Tu
v::Tv
r::Tr
x::Tx
y::Ty
ψ::Tψ
δ::Tδ
n_p::Tn_p
U_W::TU_W
ψ_W::Tψ_W
end

function get_KVLCC2_L7_basic_params=1025.0)
Expand Down
Loading

0 comments on commit 97cc7f3

Please sign in to comment.