Saving only specific solutions in ODE solver

I’m solving a simultaneous system of linear differential equations (about 40 million simultaneous equations). I am using QNDF solver, with option dense= false. it works well. Since I have a lot of save points, storage is an issue. I don’t want to store all 40 million values at my save points. I just want the ODE solver to save the average of all the values, at each save point. I am aware of call backs in Julia, but I’m unsure of how to utilise that for my problem. Kindly suggest codes to solve this issue.

Note: my problem may be similar to a 3D convection diffusion type equations but not exactly that. If any further information is required I will be willing to share.

1 Like

There is a save_idxs keyword that tells the solver only to save certain variables Common Solver Options (Solve Keyword Arguments) · DifferentialEquations.jl.

I suppose you could make save_idxs save none of the variables, and then use Output and Saving Controls · DiffEqCallbacks.jl to save your quantity of interest

1 Like