# Solve(ode, Tsit5()) throws "Possible method error" in VS Code

**URL:** <https://discourse.julialang.org/t/solve-ode-tsit5-throws-possible-method-error-in-vs-code/77623>\
**Category:** VS Code\
**Tags:** differentialequation\
**Created:** [March 9, 2022, 9:39am UTC](https://discourse.julialang.org/t/solve-ode-tsit5-throws-possible-method-error-in-vs-code/77623 "2022-03-09T09:39:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spinystellate](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@spinystellate](https://discourse.julialang.org/u/spinystellate)\
**Post date:** [March 9, 2022, 9:39am UTC](https://discourse.julialang.org/t/solve-ode-tsit5-throws-possible-method-error-in-vs-code/77623/1 "2022-03-09T09:39:50Z")

</div>

I am new to Julia and have started implementing my project in a Jupyter notebook. As this is not great for debugging, I have now implemented the same code in VS Code. For reasons I don’t understand, the program throws an error when I try to specify a solver for my ODE problem:

sol = solve(ode, Tsit5())

There is no error if I change the above line to this:

sol = solve(ode)

The addition of other keyword argument pairs works fine too:

sol = solve(ode, saveat=ts, tstops=ts, dt=1e-2)

What do I need to do in VS Code to be able to specify an ODE solver in the solve function? I am using DifferentialEquations v6.18.0

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [March 9, 2022, 9:44am UTC](https://discourse.julialang.org/t/solve-ode-tsit5-throws-possible-method-error-in-vs-code/77623/2 "2022-03-09T09:44:38Z")

</div>

Please provide a minimal “working” example, it will be much easier to help you then. See:

> [@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:** ![spinystellate](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@spinystellate](https://discourse.julialang.org/u/spinystellate)\
**Post date:** [March 9, 2022, 10:36am UTC](https://discourse.julialang.org/t/solve-ode-tsit5-throws-possible-method-error-in-vs-code/77623/3 "2022-03-09T10:36:39Z")

</div>

Thank you for the quick response. I thought that this may be a general problem/ setting I didn’t know about and not specific to my code, so I did not include an example. I now see that this is not the case. Here is a simplified example of my code - it may not make much sense, but it does produce the error in VS Code:

```julia
# Load packages
using DifferentialEquations, Plots

#Model a single impulse as input
u = zeros(Int(600.0 / 0.05), 2)
u[6000:6004] .= 1

#Set parameters
A = [-1.1 0.0; 0.0 -1.1]
B = zeros(2,2,2)
C = [0.3 0.0; 0.0 0.3]

# ODE problem
function f!(x, p, t)
    A, B, C, u, dt = p

    # Get input at time t
    idx = max(Int(ceil(t/dt)), 1)
    ut = u[idx,:]

    J = A
    for i in 1:size(B, 3)
        J += B[:,:,i]*ut[i]
    end

    J*x + C*ut
end

# Forward model
function forward_model(params, x0)

    ts = range(0.05, step=0.05, stop=600.0) # sample times
    tspan = (0.0, 600.0) # time span

    ode = ODEProblem(f!, x0, tspan, params)
    sol = solve(ode, Tsit5(), saveat=ts, tstops=ts)
  
    return sol.u
end

# Test forward model
parameters = [A, B, C, u, 0.05]
x0 = zeros(2, 1) # initial condition
y = forward_model(parameters, x0)

```

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 9, 2022, 10:44am UTC](https://discourse.julialang.org/t/solve-ode-tsit5-throws-possible-method-error-in-vs-code/77623/4 "2022-03-09T10:44:00Z")

</div>

Your wording here was a bit confusing to me, but this is just the linter being incorrect about the function call – there’s no error being _thrown_. We just present a speculative info hint (as indicated by “possible” in the message).

So this is a bug, but presumably not related to your code or the package code.

---

<div class="post-metadata">

**Author:** ![spinystellate](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@spinystellate](https://discourse.julialang.org/u/spinystellate)\
**Post date:** [March 9, 2022, 11:01am UTC](https://discourse.julialang.org/t/solve-ode-tsit5-throws-possible-method-error-in-vs-code/77623/5 "2022-03-09T11:01:28Z")

</div>

It actually exited with an error earlier, but now it doesn’t and I can’t reproduce it anymore. Maybe there was another issue with my code that I removed when producing my simplified example…

I will close the issue; thank you both for your answers again!
