# MethodError: no method matching Float64(::Num) ERROR

**URL:** <https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888>\
**Category:** New to Julia\
**Tags:** error, differentialequation\
**Created:** [May 11, 2022, 2:09pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888 "2022-05-11T14:09:33Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shantanu\_Singh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shantanu_singh/32/33752_2.png) [@Shantanu\_Singh](https://discourse.julialang.org/u/Shantanu_Singh)\
**Post date:** [May 11, 2022, 2:09pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/1 "2022-05-11T14:09:33Z")

</div>

Hello, I am new to Julia. I have used MATLAB earlier. I am trying to solve a system of ODE using BoundaryValueDiffEq with the help of simple pendulum example in Julia docs and I am getting an error. Please help me resolve it.

```julia
using NeuralPDE, Flux, ModelingToolkit, GalacticOptim, Optim, DiffEqFlux, OrdinaryDiffEq,BoundaryValueDiffEq, Plots
import ModelingToolkit: Interval, infimum, supremum
@parameters eta
@variables y1(..),y2(..),y3(..),y4(..),y5(..),y6(..),y7(..),y8(..)

Deta = Differential(eta)
eta_min= 0.
eta_max = 6.0

```

```julia
lambda=-1
n=0.5
S=2.2
 beta=1.1
 K1=0.1
 rad=2
 phi0=0.005
 Pr=21
 Rhof=1150
 Rhos=19300
 Cpf=3617
 Cps=128
 Kf=0.53
 Ks=328
 tmp1=1-phi0
 tmp2=Ks-Kf
 tmp3=Ks+2*Kf
 tmp4=Cps*Rhos
 tmp5=Cpf*Rhof
 A1=tmp1+phi0*Rhos/Rhof
 A2=tmp1^(-2.5)
 A3=(2*phi0*tmp2+tmp3)/(-1*phi0*tmp2+tmp3)
 A4=tmp1+phi0*tmp4/tmp5
 eb = eta + beta

```

```julia
tspan = (0.0,6.0)
function simplependulum!(dz,z,p,eta)
 form1=A2+K1
 form2=z[2]*z[3]-z[1]*z[4]
 form3=z[2]*z[1]-z[1]*z[3]
 form4=z[1]*z[6]-z[5]*z[2]
 form5=-2*z[4]/eb
 form6=z[3]/(eb^2)
 form7=z[3]/(eb^3)
 form8=beta*A1/eb
 form9=beta*A1/eb^2
 form10=beta*A1/eb^3
 form11=K1*z[6]/eb
 form12=-1*z[6]/eb
 form13=K1/A1
 form14=z[2]/eb
 form15=-1*z[8]/eb
 vari1=beta/(eb*(A2/A1+2*form13))
 vari2=2*z[5]+z[3]+form14
 vari3=A4*Pr*beta/((A3+4/3*rad)*eb)

 formu3=form15-vari3*z[8]*z[1]
 formu2=form12-vari1*form4+form13*vari2
 formu1=(form1*(form5+form6-form7)+form8*form2+form9*form3+form10*z[2]*z[1]+form11+K1*formu2)/form1
 
 dz[1] = z[2]
 dz[2] = z[3]
 dz[3] = z[4]
 dz[4] = formu1
 dz[5] = z[6]
 dz[6] = formu2
 dz[7] = z[8]
 dz[8] = formu3
end

```

```julia
function bc1!(residual, z, p, eta)
    residual[1] = z[1][1] - S
    residual[2] = z[1][2] - lambda
    residual[3] = z[end][2] - 0.0
    residual[4] = z[end][3] - 0.0
    residual[5] = z[1][5] + n*z[1][3]
    residual[6] = z[end][5] - 0.0
    residual[7] = z[1][7] - 1.0
    residual[8] = z[end][7] - 0.0
end
bvp1 = BVProblem(simplependulum!, bc1!, [0.,0.,0.,0.,0.,0.,1.,0.], tspan)
sol1 = solve(bvp1, Shooting(Tsit5()), dt=0.1)

```

THE ERROR I AM GETTING IS:

```julia
Closest candidates are:
  (::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at C:\Users\Shantanu\AppData\Local\Programs\Julia-1.7.2\share\julia\base\rounding.jl:200
  (::Type{T})(::T) where T<:Number at C:\Users\Shantanu\AppData\Local\Programs\Julia-1.7.2\share\julia\base\boot.jl:770
  (::Type{T})(::SymbolicUtils.Symbolic) where T<:Union{AbstractFloat, Integer, Complex{<:Integer}, Complex{<:AbstractFloat}} at C:\Users\Shantanu\.julia\packages\Symbolics\vQXbU\src\Symbolics.jl:135
  ...

Stacktrace:
  [1] convert(#unused#::Type{Float64}, x::Num)
    @ Base .\number.jl:7
  [2] setindex!(A::Vector{Float64}, x::Num, i1::Int64)
    @ Base .\array.jl:903
  [3] simplependulum!(dz::Vector{Float64}, z::Vector{Float64}, p::SciMLBase.NullParameters, eta::Float64)
    @ Main .\In[125]:31
  [4] ODEFunction
    @ C:\Users\Shantanu\.julia\packages\SciMLBase\nbKmA\src\scimlfunctions.jl:345 [inlined]
  [5] initialize!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Vector{Float64}, Nothing, Float64, SciMLBase.NullParameters, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, BVProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(simplependulum!), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, typeof(bc1!), SciMLBase.StandardBVProblem, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(simplependulum!), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(simplependulum!), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}, cache::OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False})
    @ OrdinaryDiffEq C:\Users\Shantanu\.julia\packages\OrdinaryDiffEq\ZBye7\src\perform_step\low_order_rk_perform_step.jl:627
  [6] __init(prob::BVProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(simplependulum!), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, typeof(bc1!), SciMLBase.StandardBVProblem, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, alg::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, timeseries_init::Tuple{}, ts_init::Tuple{}, ks_init::Tuple{}, recompile::Type{Val{true}}; saveat::Tuple{}, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Nothing, callback::Nothing, dense::Bool, calck::Bool, dt::Float64, dtmin::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Nothing, reltol::Nothing, qmin::Rational{Int64}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, beta1::Nothing, beta2::Nothing, qoldinit::Rational{Int64}, controller::Nothing, fullnormalize::Bool, failfactor::Int64, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(LinearAlgebra.opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEq.DefaultInit, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ OrdinaryDiffEq C:\Users\Shantanu\.julia\packages\OrdinaryDiffEq\ZBye7\src\solve.jl:456
  [7] #__solve#502
    @ C:\Users\Shantanu\.julia\packages\OrdinaryDiffEq\ZBye7\src\solve.jl:4 [inlined]
  [8] #solve_call#39
    @ C:\Users\Shantanu\.julia\packages\DiffEqBase\U3LtB\src\solve.jl:155 [inlined]
  [9] #solve_up#41
    @ C:\Users\Shantanu\.julia\packages\DiffEqBase\U3LtB\src\solve.jl:182 [inlined]
 [10] #solve#40
    @ C:\Users\Shantanu\.julia\packages\DiffEqBase\U3LtB\src\solve.jl:168 [inlined]
 [11] (::BoundaryValueDiffEq.var"#18#19"{Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:dt,), Tuple{Float64}}}, BVProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(simplependulum!), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, typeof(bc1!), SciMLBase.StandardBVProblem, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, Shooting{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, BoundaryValueDiffEq.var"#1#2"}, typeof(bc1!)})(resid::Vector{Float64}, minimizer::Vector{Float64})
    @ BoundaryValueDiffEq C:\Users\Shantanu\.julia\packages\BoundaryValueDiffEq\fnUX7\src\solve.jl:11
 [12] (::NLSolversBase.var"#fj_finitediff!#21"{BoundaryValueDiffEq.var"#18#19"{Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:dt,), Tuple{Float64}}}, BVProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(simplependulum!), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, typeof(bc1!), SciMLBase.StandardBVProblem, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, Shooting{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, BoundaryValueDiffEq.var"#1#2"}, typeof(bc1!)}, FiniteDiff.JacobianCache{Vector{Float64}, Vector{Float64}, Vector{Float64}, UnitRange{Int64}, Nothing, Val{:central}(), Float64}})(F::Vector{Float64}, J::Matrix{Float64}, x::Vector{Float64})
    @ NLSolversBase C:\Users\Shantanu\.julia\packages\NLSolversBase\cfJrN\src\objective_types\oncedifferentiable.jl:138
 [13] value_jacobian!!(obj::OnceDifferentiable{Vector{Float64}, Matrix{Float64}, Vector{Float64}}, F::Vector{Float64}, J::Matrix{Float64}, x::Vector{Float64})
    @ NLSolversBase C:\Users\Shantanu\.julia\packages\NLSolversBase\cfJrN\src\interface.jl:124
 [14] value_jacobian!!
    @ C:\Users\Shantanu\.julia\packages\NLSolversBase\cfJrN\src\interface.jl:122 [inlined]
 [15] trust_region_(df::OnceDifferentiable{Vector{Float64}, Matrix{Float64}, Vector{Float64}}, initial_x::Vector{Float64}, xtol::Float64, ftol::Float64, iterations::Int64, store_trace::Bool, show_trace::Bool, extended_trace::Bool, factor::Float64, autoscale::Bool, cache::NLsolve.NewtonTrustRegionCache{Vector{Float64}})
    @ NLsolve C:\Users\Shantanu\.julia\packages\NLsolve\gJL1I\src\solvers\trust_region.jl:119
 [16] trust_region (repeats 2 times)
    @ C:\Users\Shantanu\.julia\packages\NLsolve\gJL1I\src\solvers\trust_region.jl:235 [inlined]
 [17] nlsolve(df::OnceDifferentiable{Vector{Float64}, Matrix{Float64}, Vector{Float64}}, initial_x::Vector{Float64}; method::Symbol, xtol::Float64, ftol::Float64, iterations::Int64, store_trace::Bool, show_trace::Bool, extended_trace::Bool, linesearch::LineSearches.Static, linsolve::NLsolve.var"#27#29", factor::Float64, autoscale::Bool, m::Int64, beta::Int64, aa_start::Int64, droptol::Float64)
    @ NLsolve C:\Users\Shantanu\.julia\packages\NLsolve\gJL1I\src\nlsolve\nlsolve.jl:26
 [18] nlsolve(f::Function, initial_x::Vector{Float64}; method::Symbol, autodiff::Symbol, inplace::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ NLsolve C:\Users\Shantanu\.julia\packages\NLsolve\gJL1I\src\nlsolve\nlsolve.jl:52
 [19] nlsolve(f::Function, initial_x::Vector{Float64})
    @ NLsolve C:\Users\Shantanu\.julia\packages\NLsolve\gJL1I\src\nlsolve\nlsolve.jl:46
 [20] #1
    @ C:\Users\Shantanu\.julia\packages\BoundaryValueDiffEq\fnUX7\src\algorithms.jl:11 [inlined]
 [21] __solve(prob::BVProblem{Vector{Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, ODEFunction{true, typeof(simplependulum!), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, typeof(bc1!), SciMLBase.StandardBVProblem, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, alg::Shooting{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, BoundaryValueDiffEq.var"#1#2"}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:dt,), Tuple{Float64}}})
    @ BoundaryValueDiffEq C:\Users\Shantanu\.julia\packages\BoundaryValueDiffEq\fnUX7\src\solve.jl:15

```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 11, 2022, 2:28pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/2 "2022-05-11T14:28:20Z")

</div>

That error says it doesn’t know how to handle a symbolic value. When I run your code, `eta` is not defined, so I assume that in a previous case you defined `eta` to be a symbolic variable then switched to doing this without clearing your variable.

---

<div class="post-metadata">

**Author:** ![Shantanu\_Singh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shantanu_singh/32/33752_2.png) [@Shantanu\_Singh](https://discourse.julialang.org/u/Shantanu_Singh)\
**Post date:** [May 11, 2022, 3:35pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/3 "2022-05-11T15:35:05Z")

</div>

I have now posted the whole code and I have defined eta as a parameter.Can you please have a look at it again?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 11, 2022, 3:43pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/4 "2022-05-11T15:43:25Z")

</div>

I don’t understand your code. Why is `eta` defined as symbolic there, but then you use the BVP solver? Those are two completely different packages: one is NeuralPDE stuff and the other is BoundaryValueDiffEq.jl

I guess let’s take a step back, what are you trying to do? Are you trying to solve the BVP, but `eta_min` and `eta_max`, are you trying to solve the BVP and estimate eta?

---

<div class="post-metadata">

**Author:** ![Shantanu\_Singh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shantanu_singh/32/33752_2.png) [@Shantanu\_Singh](https://discourse.julialang.org/u/Shantanu_Singh)\
**Post date:** [May 11, 2022, 3:51pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/5 "2022-05-11T15:51:51Z")

</div>

I have used pinn to solve my system of ODE, thats why there is NeuralPDE stuff and I wanted to compare that solution to the solution from BVP solvers.I want eta to be an independent variable like t is for time generally.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 11, 2022, 3:59pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/6 "2022-05-11T15:59:42Z")

</div>

Oh I see, eta is your independent variable. So then what is `eb`? Is that a quantity dependent on the independent variable?

---

<div class="post-metadata">

**Author:** ![Shantanu\_Singh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shantanu_singh/32/33752_2.png) [@Shantanu\_Singh](https://discourse.julialang.org/u/Shantanu_Singh)\
**Post date:** [May 11, 2022, 4:00pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/7 "2022-05-11T16:00:10Z")

</div>

Yes it is eta + a constant term

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 11, 2022, 4:01pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/8 "2022-05-11T16:01:15Z")

</div>

Yeah so you should move `eb = eta + beta` into `simplependulum!` so it’s calculated differently at each eta-point.

---

<div class="post-metadata">

**Author:** ![Shantanu\_Singh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shantanu_singh/32/33752_2.png) [@Shantanu\_Singh](https://discourse.julialang.org/u/Shantanu_Singh)\
**Post date:** [May 11, 2022, 4:03pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/9 "2022-05-11T16:03:38Z")

</div>

Oh yes you are right!!  
Thanks!

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 11, 2022, 4:04pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/10 "2022-05-11T16:04:22Z")

</div>

Yeah so `eta` was basically just not defined, it was just picking up the definition from your NeuralPDE.jl code, hence the weird error when the symbolic variable ended up in the BVP solver. No problem.

---

<div class="post-metadata">

**Author:** ![Shantanu\_Singh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shantanu_singh/32/33752_2.png) [@Shantanu\_Singh](https://discourse.julialang.org/u/Shantanu_Singh)\
**Post date:** [May 13, 2022, 4:41pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/11 "2022-05-13T16:41:09Z")

</div>

Can you tell me how to give initial guess as function of t or eta(in my case) in BVProblem?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 13, 2022, 7:42pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/12 "2022-05-13T19:42:23Z")

</div>

Make `u0` be an `AbstractArray{>:AbstractArray})`, i.e. an array of arrays.

---

<div class="post-metadata">

**Author:** ![Kumail\_Haider](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kumail_haider/32/32253_2.png) [@Kumail\_Haider](https://discourse.julialang.org/u/Kumail_Haider)\
**Post date:** [October 1, 2022, 6:48pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/13 "2022-10-01T18:48:36Z")

</div>

I am getting exactly the same MethodError :no method matching Float64(::Num) but code is different. Can you explain what you learned about that error ? What is main cause ? How to solve ?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 1, 2022, 8:54pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/14 "2022-10-01T20:54:52Z")

</div>

Please post code in a new thread. As the error says, it’s just from trying to convert a `Num` to a `Float64`. Why is it doing that? I don’t know, I haven’t seen your code. Did you define a `Vector{Float64}` and then a[i] = v`for`v`a`Num`?

---

<div class="post-metadata">

**Author:** ![Kumail\_Haider](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kumail_haider/32/32253_2.png) [@Kumail\_Haider](https://discourse.julialang.org/u/Kumail_Haider)\
**Post date:** [October 2, 2022, 4:14am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/16 "2022-10-02T04:14:57Z")

</div>

Dict line is main source of error.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 2, 2022, 8:22am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/17 "2022-10-02T08:22:28Z")

</div>

> [@Kumail\_Haider](#):
>
> Matrix{Float64}(substitute.(M, (Dict([p =\> prob]),)))

Is `substitute.(M, (Dict([p => prob]),))` a `Matrix{Num}` that then just happens to all be Float64 numbers? Can you boil this down into an MWE?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 3, 2022, 1:05pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-num-error/80888/19 "2022-10-03T13:05:01Z")

</div>

What is computed? Show before the plot
