# DifferentialEquations.jl Tutorial on BV Porblem

**URL:** <https://discourse.julialang.org/t/differentialequations-jl-tutorial-on-bv-porblem/77346>\
**Category:** New to Julia\
**Tags:** package, differentialequation\
**Created:** [March 3, 2022, 10:44am UTC](https://discourse.julialang.org/t/differentialequations-jl-tutorial-on-bv-porblem/77346 "2022-03-03T10:44:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NilsBruch](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@NilsBruch](https://discourse.julialang.org/u/NilsBruch)\
**Post date:** [March 3, 2022, 10:44am UTC](https://discourse.julialang.org/t/differentialequations-jl-tutorial-on-bv-porblem/77346/1 "2022-03-03T10:44:15Z")

</div>

Tthe tutorial section of DifferentialEquations.jl on Boundary Value Problems states that: " The third argument of `BVProblem` is the initial guess of the solution, which is constant in this example."

In this example the constant guess is u(t)=pi/2 and u’(t)=pi/2 for all t from the time interval. How can I make a nonconstant guess such as u(t)=sin(t) & u’(t)=cos(t)?

---

<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:** [June 4, 2022, 12:22pm UTC](https://discourse.julialang.org/t/differentialequations-jl-tutorial-on-bv-porblem/77346/2 "2022-06-04T12:22:16Z")

</div>

You just use an array of arrays, for example, `u = [[1.0].[2.0],[3.0]]`, matching the size of the solution.

---

<div class="post-metadata">

**Author:** ![NilsBruch](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@NilsBruch](https://discourse.julialang.org/u/NilsBruch)\
**Post date:** [June 4, 2022, 7:49pm UTC](https://discourse.julialang.org/t/differentialequations-jl-tutorial-on-bv-porblem/77346/3 "2022-06-04T19:49:43Z")

</div>

Thanks for your response! But when I do that and I have an initial guess of the form u0 = [[0],[1],[2],…[lengthOfTheSolution]] then the solver throws the error: DimensionMismatch(“tried to assign 62 elements to 1 destinations”) where 62 is the designated length of the solution.

I thought maybe you meant for the pendulum for example where the solution is two dimensional, that u0 would need to be u0= [[0,0],[1,1],[2,3],…[lengthOfSolution, lengthOfSolution] ] but this throws the exact same 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:** [June 4, 2022, 8:35pm UTC](https://discourse.julialang.org/t/differentialequations-jl-tutorial-on-bv-porblem/77346/4 "2022-06-04T20:35:28Z")

</div>

Ahh open an issue because that should be it. Include the code you ran.
