# How to address an error?

**URL:** <https://discourse.julialang.org/t/how-to-address-an-error/93191>\
**Category:** General Usage\
**Tags:** question, intervals\
**Created:** [January 19, 2023, 4:44am UTC](https://discourse.julialang.org/t/how-to-address-an-error/93191 "2023-01-19T04:44:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kanishk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kanishk/32/46224_2.png) [@Kanishk](https://discourse.julialang.org/u/Kanishk)\
**Post date:** [January 19, 2023, 4:44am UTC](https://discourse.julialang.org/t/how-to-address-an-error/93191/1 "2023-01-19T04:44:03Z")

</div>

Hello,

I am trying to find the steady state (or roots) of a system with 9 states using the Krawczyk method. For that I need to find a Jacobian, but I am getting the following error-  
" BoundsError: attempt to access 0-element Vector{ForwardDiff.Dual{ForwardDiff.Tag{Main.var"workspace#44".var"#1#2"{typeof(Main.var"workspace#44".large\_model)}, Float64}, Float64, 0}} at index [1] "

A section of code which is giving error is-  
"  
local XYnew = [(0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50)]   
jacobian(large\_model, XYnew) = ForwardDiff.jacobian(x → large\_model(x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9]), XYnew)  
"  
I am using “IntervalArithmetic.jl” package in Julia.  
Please resolve the issue.

Thank you

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [January 19, 2023, 11:18am UTC](https://discourse.julialang.org/t/how-to-address-an-error/93191/2 "2023-01-19T11:18:26Z")

</div>

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 19, 2023, 11:59am UTC](https://discourse.julialang.org/t/how-to-address-an-error/93191/3 "2023-01-19T11:59:56Z")

</div>

> [@Kanishk](#):
>
> XYnew = [(0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50)]

I tried:

```julia
using IntervalArithmetic
XYnew = [(0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50)] 

```

which fails with:

```julia
julia> XYnew = [(0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50), (0…50)]
ERROR: UndefVarError: `…` not defined
Stacktrace:
 [1] top-level scope
   @ REPL[7]:1

```

Can you copy and paste a complete example that shows the error you reported?

And include the example in triple back-ticks?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 19, 2023, 1:25pm UTC](https://discourse.julialang.org/t/how-to-address-an-error/93191/5 "2023-01-19T13:25:06Z")

</div>

If I try to run your code I get:

```julia
julia> local mid_XYnew = [mid(XYnew[1]), mid(XYnew[2]), mid(XYnew[3]), mid(XYnew[4]), 
       mid(XYnew[5]), mid(XYnew[6]), mid(XYnew[7]), mid(XYnew[8]), mid(XYnew[9])]
ERROR: UndefVarError: XYnew not defined
Stacktrace:
 [1] top-level scope
   @ REPL[24]:1

```

Can you check?

Also your indentation is a bit strange. Global code is usually not indented, but most of your code is global. And I am not sure if it makes sense to use the “local” keyword outside of a function.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [January 6, 2024, 8:05pm UTC](https://discourse.julialang.org/t/how-to-address-an-error/93191/6 "2024-01-06T20:05:21Z")

</div>

Use two dots instead of three dots:

```julia
0..50

```

(Sorry for the very late reply.)
