Skip to content

Mark null ODE solutions as dense #1155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025
Merged

Mark null ODE solutions as dense #1155

merged 2 commits into from
May 14, 2025

Conversation

ChrisRackauckas
Copy link
Member

We actually know the entire time series for the solution, so we should state that we know that via dense=true.

using OrdinaryDiffEqDefault, ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D

@variables x(t) y(t)
eqs = [y ~ x, y ~ sin(t)]
@mtkbuild sys = ODESystem(eqs, t)

tspan = (0.0, 10.0)
prob = ODEProblem(sys, [], tspan)
sol = solve(prob)
using Plots
plot(sol, idxs = [x])
savefig("plot.png")

Before and after

We actually know the entire time series for the solution, so we should state that we know that via `dense=true`.

```julia
using OrdinaryDiffEqDefault, ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D

@variables x(t) y(t)
eqs = [y ~ x, y ~ sin(t)]
@mtkbuild sys = ODESystem(eqs, t)

tspan = (0.0, 10.0)
prob = ODEProblem(sys, [], tspan)
sol = solve(prob)
using Plots
plot(sol, idxs = [x])
savefig("plot.png")
```

Before and after
@ChrisRackauckas
Copy link
Member Author

Before:
image

After:
plot

@ChrisRackauckas ChrisRackauckas merged commit e300adf into master May 14, 2025
42 of 48 checks passed
@ChrisRackauckas ChrisRackauckas deleted the nulldense branch May 14, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant