-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Periodic piecewise functions #21215
Comments
comment:1
My vote is for 1). As you seem to have a use case can you be please more detailed? |
comment:2
Replying to @rwst:
Glad to hear; this is what I would strongly prefer too. Right now the result of
My first use case is in subadditive periodic piecewise linear functions, the periodic extensions of what can be seen here: Generalizing slightly, I would actually like support for quasiperiodic piecewise functions -- that is, periodic plus a linear function. There is an algebraic viewpoint using group actions on this as well, which is useful for further generalizations, in particular for piecewise functions of several variables (#20877). |
comment:3
Replying to @mkoeppe:
Possibly we can enforce Sage's convention to give back the same type as the type of the input. Meanwhile you can do
You are certainly aware that if they have one periodic piece they can be all expressed in terms of |
comment:4
Replying to @rwst:
I guess it depends on the application whether one should consider a quasiperiodic function as a periodic+floor or as a periodic+linear. The latter is better for asymptotics. This matters for my second application, certain counting functions (http://arxiv.org/pdf/1011.6002v1.pdf page 21). |
comment:5
Replying to @mkoeppe:
Can you please help a computer scientist, where for example in that paper is such a decomposition? |
comment:6
Or did you mean decomposition into piecewise+linear. Better question: how should the piecewise quasiperiodic be represented textually? What preferred way to input them? |
comment:7
Replying to @rwst:
Take as an example the floor function.
Good enough for me if is printed as a sum of periodic and linear.
No clear preference. The linear part could perhaps just be an optional argument in the constructor. |
Dependencies: #21232 |
comment:9
By the way, I have some existing code for piecewise linear and quasiperiodic piecewise linear that could probably be adapted. It is based on the old piecewise implementation. |
I propose to add periodic piecewise functions (for now, of a single real variable).
I see two main ways of doing so:
(1) By extending
piecewise
.(2) By making a suitably general symbolic mod function (#9935) and having the user combine it with a piecewise function. (This is how it is done in Mathematica, it appears - http://community.wolfram.com/groups/-/m/t/156025; see also https://reference.wolfram.com/language/ref/Piecewise.html)
Some literature on piecewise:
Depends on #21232
CC: @kcrisman @tscrim @sagetrac-ares @novoselt @rwst @vbraun @pjbruin @burcin @jdemeyer
Component: symbolics
Issue created by migration from https://trac.sagemath.org/ticket/21215
The text was updated successfully, but these errors were encountered: