Skip to content

Commit

Permalink
Merge pull request #55 from bmad-sim/dev1
Browse files Browse the repository at this point in the history
Mixing ComplexTPS/TPS allowed, significant cleanup of operators.jl, unit testing
  • Loading branch information
mattsignorelli authored Dec 30, 2023
2 parents 0e60b2f + 600e605 commit 9388bc5
Show file tree
Hide file tree
Showing 31 changed files with 930 additions and 15,011 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ jobs:
fail-fast: false
matrix:
version:
- '1.8'
#- '1.8'
- '1.9'
- 'nightly'
- '1.10'
#- 'nightly'
os:
- ubuntu-latest
#- macos-latest
#- windows-latest
arch:
- x64
steps:
Expand Down
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ julia = "1.8"

[extras]
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Downloads"]
test = ["Test", "Downloads", "ForwardDiff", "TaylorSeries", "BenchmarkTools"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GTPSA, which uses the Truncated Power Series Algebra method for performing autom
4. **Distinction Between "Variables" and "Parameters"**: When the TPS represents a *Taylor map* of a dynamical system, which defines the evolution of map *variables* given some variations in map *parameters*, distinguishing between the two proves advantageous for analyses of Taylor maps, such as normal form


**GTPSA is fast!** See the `benchmark/fodo.jl` example for a speed comparison of `GTPSA.jl` with `ForwardDiff.jl` and `TaylorSeries.jl` in calculating a multivariable Taylor map to 2nd order.
**GTPSA is fast!** See the `benchmark/taylormap.jl` example for a speed comparison of `GTPSA.jl` with `ForwardDiff.jl` and `TaylorSeries.jl` in calculating a multivariable Taylor map to 2nd order.

## Setup
To use `GTPSA.jl`, in the Julia REPL run
Expand Down
13 changes: 9 additions & 4 deletions benchmark/fodo.jl → benchmark/taylormap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,29 @@ function benchmark_ForwardDiff()
coefs[4 ,i] = mpy(0,0,0,0,k1_0,0)
coefs[5 ,i] = mk1(0,0,0,0,k1_0,0)
coefs[6 ,i] = mk2l(0,0,0,0,k1_0,0)

coefs[7 ,i] = mxx(0,0,0,0,k1_0,0)
coefs[8 ,i] = mpxpx(0,0,0,0,k1_0,0)
coefs[9 ,i] = myy(0,0,0,0,k1_0,0)
coefs[10,i] = mpypy(0,0,0,0,k1_0,0)
coefs[11,i] = mk1k1(0,0,0,0,k1_0,0)
coefs[12,i] = mk2lk2l(0,0,0,0,k1_0,0)

coefs[13,i] = mxpx(0,0,0,0,k1_0,0)
coefs[14,i] = mxy(0,0,0,0,k1_0,0)
coefs[15,i] = mxpy(0,0,0,0,k1_0,0)
coefs[16,i] = mxk1(0,0,0,0,k1_0,0)
coefs[17,i] = mxk2l(0,0,0,0,k1_0,0)

coefs[18,i] = mpxy(0,0,0,0,k1_0,0)
coefs[19,i] = mpxpy(0,0,0,0,k1_0,0)
coefs[20,i] = mpxk1(0,0,0,0,k1_0,0)
coefs[21,i] = mpxk2l(0,0,0,0,k1_0,0)

coefs[22,i] = mypy(0,0,0,0,k1_0,0)
coefs[23,i] = myk1(0,0,0,0,k1_0,0)
coefs[24,i] = myk2l(0,0,0,0,k1_0,0)
coefs[24,i] = myk2l(0,0,0,0,k1_0,0)

coefs[25,i] = mpyk1(0,0,0,0,k1_0,0)
coefs[26,i] = mpyk2l(0,0,0,0,k1_0,0)
coefs[27,i] = mk1k2l(0,0,0,0,k1_0,0)
Expand All @@ -155,6 +160,6 @@ function benchmark_TaylorSeries()
end


m_GTPSA = @btime benchmark_GTPSA()
m_ForwardDiff = @btime benchmark_ForwardDiff()
m_TaylorSeries = @btime benchmark_TaylorSeries()
#m_GTPSA = @btime benchmark_GTPSA()
#m_ForwardDiff = @btime benchmark_ForwardDiff()
#m_TaylorSeries = @btime benchmark_TaylorSeries()
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GTPSA, which uses the Truncated Power Series Algebra method for performing autom
4. **Distinction Between "Variables" and "Parameters"**: When the TPS represents a *Taylor map* of a dynamical system, which defines the evolution of map *variables* given some variations in map *parameters*, distinguishing between the two proves advantageous for analyses of Taylor maps, such as normal form


**GTPSA is fast!** See the `benchmark/fodo.jl` example for a speed comparison of `GTPSA.jl` with `ForwardDiff.jl` and `TaylorSeries.jl` in calculating a multivariable Taylor map to 2nd order.
**GTPSA is fast!** See the `benchmark/taylormap.jl` example for a speed comparison of `GTPSA.jl` with `ForwardDiff.jl` and `TaylorSeries.jl` in calculating a multivariable Taylor map to 2nd order.

## Setup
To use `GTPSA.jl`, in the Julia REPL run
Expand Down
4 changes: 2 additions & 2 deletions docs/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ z2[params=(2=>1,)] = 1 # Set first-order part for second parameter equal to 1
z2 == k2 # Is true
```

## Using Complex TPSs
## Promotion of TPS to ComplexTPS

Mixing `ComplexTPS`s with `TPS`s is currently not allowed, however this may be added in the future. The usage for `ComplexTPS`s is the same as with regular `TPS`s, with the addition of some extra functions including `real` and `imag`.
`TPS`s and `ComplexTPS`s can be mixed freely without concern. Any time an operation with a `TPS` and a `ComplexTPS` or a `Complex` number occurs, the result will be a `ComplexTPS`. A `ComplexTPS` can be converted back to a `TPS` using the `real` and `imag` operators.


84 changes: 0 additions & 84 deletions examples/fodo.jl

This file was deleted.

27 changes: 0 additions & 27 deletions examples/gtpsa_c/gtpsa_ex0.jl

This file was deleted.

15 changes: 0 additions & 15 deletions examples/gtpsa_c/gtpsa_ex0.txt

This file was deleted.

27 changes: 0 additions & 27 deletions examples/gtpsa_c/gtpsa_ex1.jl

This file was deleted.

Loading

0 comments on commit 9388bc5

Please sign in to comment.