NonlinearOscillations / HarmonicBalance.jl

A Julia package for solving nonlinear differential equations using the harmonic balance method.
https://NonlinearOscillations.github.io/HarmonicBalance.jl/
BSD 3-Clause "New" or "Revised" License
48 stars 8 forks source link

Add an option to remove unphysical solutions data in the result object #111

Open jdelpino opened 11 months ago

jdelpino commented 11 months ago

Currently, unphysical branches are encoded with NaNs, but data about unphysical branches are kept. This is done in favor of plotting since NaNs are ignored. However, in problems where neither plotting (nor branch ordering) is important, storing unphysical branches seems an overkill. An option to sparsify data, in order to avoid storage of result objects filled with NaNs would be appreciated.

oameye commented 11 months ago

I agree. I already had I lot of annoyances with this. I propose we add a keyword to the transform_solutions function to filter the solutions of specific classes.

jdelpino commented 10 months ago

We should save by default physical solutions. We could then use simple Run-Length encoding to store the data: [https://en.wikipedia.org/wiki/Run-length_encoding]

oameye commented 6 months ago

Is filter_result! in the classification.jl file not what you want image