Skip to content
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

wsize gives an error if HTsize = "maxforwardCG" #4

Closed
aditeyashukla opened this issue Dec 12, 2023 · 1 comment · Fixed by #5
Closed

wsize gives an error if HTsize = "maxforwardCG" #4

aditeyashukla opened this issue Dec 12, 2023 · 1 comment · Fixed by #5
Assignees
Labels
bug Something isn't working

Comments

@aditeyashukla
Copy link
Contributor

If Sh is set via CLhCGfwd at max-forward CG during landing, wsize returns this error:

iterw            errW           errW1           WMTO           Wpay          Wfuel           Weng          Wfuse          Wwing           span           area         HTarea          xwbox 
    1 +1.00000000e+00 +1.00000000e+00 4.03739496e+05 1.16676863e+05 5.42665948e+04 3.22991597e+04 1.10368447e+05 5.64256961e+04 0.00000000e+00 0.00000000e+00 9.17685103e+00 1.67640000e+01
ERROR: BoundsError: attempt to access 7-element Vector{Float64} at index [8]

Error stacktrace leads to the function findsegment(x::T, xarr::Vector{T}) in airfun2.jl

Stacktrace:
  [1] getindex
    @ ./essentials.jl:13 [inlined]
  [2] findsegment(x::Float64, xarr::Vector{Float64})
    @ TASOPT.aerodynamics ~/Dropbox/Mac (2)/Documents/LAE/forks/TAESOPT.jl/src/aero/airfun2.jl:142
  [3] airfun(cl::Float64, τ::Float64, Mach::Float64, Acl::Vector{Float64}, Aτ::Vector{Float64}, AMa::Vector{Float64}, A::Array{Float64, 4}, A_M::Array{Float64, 4}, A_τ::Array{Float64, 4}, A_cl::Array{Float64, 4}, A_M_τ::Array{Float64, 4}, A_M_cl::Array{Float64, 4}, A_cl_τ::Array{Float64, 4}, A_M_cl_τ::Array{Float64, 4})
    @ TASOPT.aerodynamics ~/Dropbox/Mac (2)/Documents/LAE/forks/TAESOPT.jl/src/aero/airfun2.jl:60
  [4] airfun(cl::Float64, τ::Float64, Mach::Float64, air::TASOPT.aerodynamics.airfoil)
    @ TASOPT.aerodynamics ~/Dropbox/Mac (2)/Documents/LAE/forks/TAESOPT.jl/src/aero/airfun2.jl:23
  [5] surfcd2(S::Float64, b::Float64, bs::Float64, bo::Float64, λt::Float64, λs::Float64, γt::Float64, γs::Float64, toco::Float64, tocs::Float64, toct::Float64, Mach::Float64, sweep::Float64, co::Float64, CL::Float64, CLhtail::Float64, fLo::Float64, fLt::Float64, Reco::Float64, aRexp::Float64, kSuns::Float64, fexcd::Float64, fduo::Float64, fdus::Float64, fdut::Float64)
    @ TASOPT.aerodynamics ~/Dropbox/Mac (2)/Documents/LAE/forks/TAESOPT.jl/src/aero/surfcd.jl:122
  [6] cdsum!(pari::Vector{Int64}, parg::Vector{Float64}, para::SubArray{Float64, 1, Array{Float64, 3}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64, Int64}, true}, pare::SubArray{Float64, 1, Array{Float64, 3}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64, Int64}, true}, icdfun::Int64)
    @ TASOPT.aerodynamics ~/Dropbox/Mac (2)/Documents/LAE/forks/TAESOPT.jl/src/aero/cdsum.jl:134
  [7] wsize(pari::Vector{Int64}, parg::Vector{Float64}, parm::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, para::SubArray{Float64, 2, Array{Float64, 3}, Tuple{Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}, Int64}, true}, pare::SubArray{Float64, 2, Array{Float64, 3}, Tuple{Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}, Int64}, true}, itermax::Int64, wrlx1::Float64, wrlx2::Float64, wrlx3::Float64, initwgt::Bool, initeng::Int64, iairf::Int64, Ldebug::Bool, printiter::Bool, saveODperf::Bool)
    @ TASOPT ~/Dropbox/Mac (2)/Documents/LAE/forks/TAESOPT.jl/src/sizing/wsize.jl:1344
  [8] size_aircraft!(ac::aircraft; iter::Int64, initwgt::Bool, Ldebug::Bool, printiter::Bool, saveOD::Bool)
    @ TASOPT ~/Dropbox/Mac (2)/Documents/LAE/forks/TAESOPT.jl/src/TASOPT.jl:111
  [9] size_aircraft!
    @ ~/Dropbox/Mac (2)/Documents/LAE/forks/TAESOPT.jl/src/TASOPT.jl:107 [inlined]
 [10] top-level scope
    @ ./timing.jl:393```
@aditeyashukla
Copy link
Contributor Author

Error occurs in all models (default as well as regional)

@askprash askprash self-assigned this Dec 12, 2023
@askprash askprash added the bug Something isn't working label Dec 14, 2023
askprash pushed a commit to askprash/TASOPT.jl that referenced this issue Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants