https://github.com/juliaapproximation/ratfun.jl
A package for working with functions expressible as a Fun divided by another Fun.
https://github.com/juliaapproximation/ratfun.jl
Last synced: 4 months ago
JSON representation
A package for working with functions expressible as a Fun divided by another Fun.
- Host: GitHub
- URL: https://github.com/juliaapproximation/ratfun.jl
- Owner: JuliaApproximation
- License: mit
- Created: 2017-05-01T09:43:21.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-04T20:56:43.000Z (over 5 years ago)
- Last Synced: 2025-01-16T06:58:29.975Z (over 1 year ago)
- Language: Julia
- Homepage:
- Size: 53.7 KB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RatFun.jl
RatFun is a package for working with functions expressible as a Fun divided by another Fun. The numerator and denominator may be different types of Funs.
## Example usage
Define two functions on an interval using ApproxFun:
```
using ApproxFun
using RatFun
p = Fun(x->exp(-10x^2))
q = Fun(x->-1+.5x*sin(100x^2)
```
You can define a RationalFun, representing p/q, as follows.
```
r = p // q
```
We use Plots.jl to plot it.
```
using Plots
plot(plot(p,title="p"),plot(q,title="q"),plot(r,title="r=p/q"),layout=grid(3,1))
```

You can also do the same for Funs with more exotic types, such as those with Dirac deltas, as follows.
```
p2 = .7*DiracDelta(-1.25) - .9*DiracDelta(.5) + p
q2 = .5*KroneckerDelta(-1.25) - .7*KroneckerDelta(.5) + q
r2 = p2 // q2
plot(plot(p2,title="p2"),plot(q2,title="q2"),plot(r2,title="r2=p2/q2"),layout=grid(3,1))
```

RationalFuns with Dirac deltas in the numerator are used in the SpectralMeasures package.