# Boundary Value Problem with ModellingToolkit or DiffEqOperators

**URL:** https://discourse.julialang.org/t/boundary-value-problem-with-modellingtoolkit-or-diffeqoperators/57656
**Category:** Modelling & Simulations
**Tags:** question, diffeq, modelingtoolkit
**Created:** [March 21, 2021, 2:10pm UTC](https://discourse.julialang.org/t/boundary-value-problem-with-modellingtoolkit-or-diffeqoperators/57656 "2021-03-21T14:10:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kkakosim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kkakosim/32/21546_2.png) [@kkakosim](https://discourse.julialang.org/u/kkakosim)
#### Post date: [March 21, 2021, 2:10pm UTC](https://discourse.julialang.org/t/boundary-value-problem-with-modellingtoolkit-or-diffeqoperators/57656/1 "2021-03-21T14:10:05Z")

</div>

At first I thought that there was a bug in the packages but probably I am doing something (completely wrong). I am trying to run the bellow spherical coordinates system with Boundary Values. But not sure if it even makes sense…

```julia
@parameters r
@variables T(..)
D = Differential(r)

kc = 25.
ks = 385.
Tf = 350.
Rc = 0.005
Rs = 1.5 * Rc
h = 100.
Sc = 0.
Tinit = 298.
	
# 1D ODE and boundary conditions
eq = [0 ~ (1/r^2) * D( (1/r^2) * kc * D( T(r) ) ) + Sc,
      0~ D(T(0)),
      0~ D(T(Rs)) - h * (T(Rs) - Tf)]  

# ODE system
sys = ODESystem(eq, T)
p=[]
T0 = [T => Tinit]
rspan=(0.0 , Rs)
prob = ODEProblem(sys, T0, rspan, p)

# Solve ODE problem
sol = solve(prob)

```

---

<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: [March 21, 2021, 5:01pm UTC](https://discourse.julialang.org/t/boundary-value-problem-with-modellingtoolkit-or-diffeqoperators/57656/2 "2021-03-21T17:01:23Z")

</div>

BVPs are not supported in MTK right now. Please open an issue. You can use `BVProblem` from DifferentialEquations.jl directly for now though.

[https://diffeq.sciml.ai/stable/tutorials/bvp\_example/](https://diffeq.sciml.ai/stable/tutorials/bvp_example/)

---

<div class="post-metadata">

### Author: ![kkakosim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kkakosim/32/21546_2.png) [@kkakosim](https://discourse.julialang.org/u/kkakosim)
#### Post date: [March 21, 2021, 8:40pm UTC](https://discourse.julialang.org/t/boundary-value-problem-with-modellingtoolkit-or-diffeqoperators/57656/3 "2021-03-21T20:40:43Z")

</div>

thanks for the update. For reference here is the issue  
[https://github.com/SciML/ModelingToolkit.jl/issues/924](https://github.com/SciML/ModelingToolkit.jl/issues/924)

BTW, is there a way to set BCs for the derivatives (Neumann, Robin)?

---

<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: [March 21, 2021, 8:45pm UTC](https://discourse.julialang.org/t/boundary-value-problem-with-modellingtoolkit-or-diffeqoperators/57656/4 "2021-03-21T20:45:00Z")

</div>

> [@kkakosim](#):
>
> BTW, is there a way to set BCs for the derivatives (Neumann, Robin)?

Yes, in PDESystem form.
