# Use of caveat in common solve

**URL:** https://discourse.julialang.org/t/use-of-caveat-in-common-solve/93243
**Category:** General Usage
**Created:** [January 20, 2023, 1:51am UTC](https://discourse.julialang.org/t/use-of-caveat-in-common-solve/93243 "2023-01-20T01:51:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [January 20, 2023, 1:51am UTC](https://discourse.julialang.org/t/use-of-caveat-in-common-solve/93243/1 "2023-01-20T01:51:46Z")

</div>

@ChrisRackauckas,

I get the error message:

```julia
┌ Warning: Endpoints do not match. Return code: Success. Likely your time range is not a multiple of `saveat`. sol.t[end]: 75.398224, ts[end]: 0.0

```

because I am using `saveat` as an integer to represent the number of times to save the solution when calling `solve` after calling `ODEProblem`.

```julia
 dudt_ude!(du,u,p,t) = dudt_univ!(du,u,p,t,protocols[k], dct)
        prob_univ = ODEProblem(dudt_ude!, σ0, tspan, θ0) 
        saveat = dct[:pts_per_cycle] * dct[:Ncycles] # an integer
        println("saveat 2: ", saveat)]
        sol_pre = solve(prob_univ, Tsit5(),abstol = 1e-8, reltol = 1e-6, saveat=saveat)

```

What conditions must be satisfied for the warning error not to occur?

The end time is some real number based on \pi so the end time is irrational.

Thanks,

---

<div class="post-metadata">

### Author: ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)
#### Post date: [January 20, 2023, 5:18pm UTC](https://discourse.julialang.org/t/use-of-caveat-in-common-solve/93243/2 "2023-01-20T17:18:57Z")

</div>

`saveat` as a number expands to `tspan[1]:saveat:tspan[2]`, so it should be the interval between saves, not the number of saves. In you case maybe `saveat=2π/dct[:pts_per_cycle]`?

---

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [January 20, 2023, 5:21pm UTC](https://discourse.julialang.org/t/use-of-caveat-in-common-solve/93243/3 "2023-01-20T17:21:42Z")

</div>

You are correct. I misinterpreted the meaning of a:n:c. Thanksl!
