Closed francispoulin closed 4 years ago
Sorrry, my mistake. I tried using NLsolve and that worked fine, as did defining the function. What it didn't seem to like was the u = solve().
The error I get is the following.
Iter f(x) inf-norm Step 2-norm
------ -------------- --------------
BoundsError: attempt to access 1-element Array{Array{Float64,2},1} at index [2]
Stacktrace:
[1] dNdξ(::Array{Array{Float64,2},1}) at ./In[2]:5
[2] J at ./In[3]:6 [inlined]
[3] f_int(::Array{Array{Float64,2},1}, ::Array{Float64,2}, ::#dNdξ, ::Float64, ::Float64, ::Int64) at ./In[3]:23
[4] (::#f#3{Array{Int64,1},Array{Float64,2},Array{Float64,2}})(::Array{Float64,1}) at ./In[6]:10
[5] (::NLsolve.#f!#19{#f#3{Array{Int64,1},Array{Float64,2},Array{Float64,2}}})(::Array{Float64,1}, ::Array{Float64,1}) at /home/fpoulin/.julia/v0.6/NLsolve/src/utils.jl:41
[6] (::NLsolve.#fg!#3{Symbol,NLsolve.#f!#19{#f#3{Array{Int64,1},Array{Float64,2},Array{Float64,2}}}})(::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,2}) at /home/fpoulin/.julia/v0.6/NLsolve/src/differentiable_functions.jl:21
[7] trust_region_(::NLsolve.DifferentiableMultivariateFunction, ::Array{Float64,1}, ::Float64, ::Float64, ::Int64, ::Bool, ::Bool, ::Bool, ::Float64, ::Bool) at /home/fpoulin/.julia/v0.6/NLsolve/src/trust_region.jl:105
[8] #nlsolve#11(::Symbol, ::Float64, ::Float64, ::Int64, ::Bool, ::Bool, ::Bool, ::Function, ::Float64, ::Bool, ::Int64, ::Float64, ::NLsolve.#nlsolve, ::NLsolve.DifferentiableMultivariateFunction, ::Array{Float64,1}) at /home/fpoulin/.julia/v0.6/NLsolve/src/nlsolve_func_defs.jl:26
[9] (::NLsolve.#kw##nlsolve)(::Array{Any,1}, ::NLsolve.#nlsolve, ::NLsolve.DifferentiableMultivariateFunction, ::Array{Float64,1}) at ./<missing>:0
[10] #nlsolve#13(::Symbol, ::Float64, ::Float64, ::Int64, ::Bool, ::Bool, ::Bool, ::Function, ::Float64, ::Bool, ::Int64, ::Float64, ::Bool, ::NLsolve.#nlsolve, ::NLsolve.#f!#19{#f#3{Array{Int64,1},Array{Float64,2},Array{Float64,2}}}, ::Array{Float64,1}) at /home/fpoulin/.julia/v0.6/NLsolve/src/nlsolve_func_defs.jl:80
[11] (::NLsolve.#kw##nlsolve)(::Array{Any,1}, ::NLsolve.#nlsolve, ::Function, ::Array{Float64,1}) at ./<missing>:0
[12] solve() at ./In[6]:16
[13] include_string(::String, ::String) at ./loading.jl:515
I am trying to run this tutorial and it uses NLsolve but I can't seem to load it when I try
Pkg.add("NLsolve")
Is this something I can find elsewhere/
https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/docs/tutorials/2015-05-23-one-element-solution.ipynb
u``` sing NLsolve
function solve()
end
u = solve()