diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 83fd773..0a21ffb 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.2","generation_timestamp":"2024-08-28T15:38:29","documenter_version":"1.6.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.2","generation_timestamp":"2024-08-28T15:43:28","documenter_version":"1.6.0"}} \ No newline at end of file diff --git a/dev/fulldocs/index.html b/dev/fulldocs/index.html index 36867f6..50e3560 100644 --- a/dev/fulldocs/index.html +++ b/dev/fulldocs/index.html @@ -1,2 +1,2 @@ -Full documentation · TaylorInterface.jl

Full documentation

Main structures

TaylorInterface.TaylorGeneratorType
TaylorGenerator(name=randstring(12), eqs_filename, parent_path=".")

Structure used to generate directories and call taylor. The directory name will be $(parent_path)/taylor_$(name). The equation file should follow the syntax required by taylor.

source

Around the TaylorGenerator

TaylorInterface.generate_dirFunction
generate_dir(generator, silent=false)

Generates the directory corresponding to the generator, and builds the library. If silent is true, command will be silent apart from errors.

source
TaylorInterface.get_handlerFunction
get_handler(generator, open=true)

Get the TaylorHandler corresponding to the generator. If open is true, the library will also be open in the handler.

source

Around the TaylorHandler

TaylorInterface.compile_eqsFunction
compile_eqs(generator, silent=false)

Runs make in the directory of the generator. If silent is true, runs make -s, thus being silent (apart from errors).

source
compile_eqs(handler, silent=false)

Runs make in the directory of the handler. If silent is true, runs make -s, thus being silent (apart from errors).

source
TaylorInterface.open_libFunction
open_lib(handler)

Opens the handler's library, storing the loaded library and a dictionary with symbols to functions in the handler.

Currently, the loaded functions are flow, tstep and tstep_reverse.

source

Integration functions

TaylorInterface.flow!Function
flow!(han, x, [y], t, df=Ref(nothing))

Wrapper function around the C flow function in the han TaylorHandler.

df should be passed as a vector if jet transport is used. In this case, jet transport results will be stored in df.

If y is passed, the flow result will be stored in it.

source
TaylorInterface.flowFunction
flow(han, x, t)

Wrapper function around the C flow function in the han TaylorHandler. Should only be used if jet transport isn't used; otherwise, use flow!.

source

Default models

TaylorInterface.get_modelFunction
get_model(name, open=false)

Get the TaylorHandler corresponding to a default model in this package. If open is true, the library will also be open in the handler.

Warning: name should NOT contain the prefix "taylor_h".

source

Internal functions

File system navigation

These functions are mainly intended for internal use and navigation within the file system.

Taylor flags

+Full documentation · TaylorInterface.jl

Full documentation

Main structures

TaylorInterface.TaylorGeneratorType
TaylorGenerator(name=randstring(12), eqs_filename, parent_path=".")

Structure used to generate directories and call taylor. The directory name will be $(parent_path)/taylor_$(name). The equation file should follow the syntax required by taylor.

source

Around the TaylorGenerator

TaylorInterface.generate_dirFunction
generate_dir(generator, silent=false)

Generates the directory corresponding to the generator, and builds the library. If silent is true, command will be silent apart from errors.

source
TaylorInterface.get_handlerFunction
get_handler(generator, open=true)

Get the TaylorHandler corresponding to the generator. If open is true, the library will also be open in the handler.

source

Around the TaylorHandler

TaylorInterface.compile_eqsFunction
compile_eqs(generator, silent=false)

Runs make in the directory of the generator. If silent is true, runs make -s, thus being silent (apart from errors).

source
compile_eqs(handler, silent=false)

Runs make in the directory of the handler. If silent is true, runs make -s, thus being silent (apart from errors).

source
TaylorInterface.open_libFunction
open_lib(handler)

Opens the handler's library, storing the loaded library and a dictionary with symbols to functions in the handler.

Currently, the loaded functions are flow, tstep and tstep_reverse.

source

Integration functions

TaylorInterface.flow!Function
flow!(han, x, [y], t, df=Ref(nothing))

Wrapper function around the C flow function in the han TaylorHandler.

df should be passed as a vector if jet transport is used. In this case, jet transport results will be stored in df.

If y is passed, the flow result will be stored in it.

source
TaylorInterface.flowFunction
flow(han, x, t)

Wrapper function around the C flow function in the han TaylorHandler. Should only be used if jet transport isn't used; otherwise, use flow!.

source

Default models

TaylorInterface.get_modelFunction
get_model(name, open=false)

Get the TaylorHandler corresponding to a default model in this package. If open is true, the library will also be open in the handler.

Warning: name should NOT contain the prefix "taylor_h".

source

Internal functions

File system navigation

These functions are mainly intended for internal use and navigation within the file system.

Taylor flags

diff --git a/dev/index.html b/dev/index.html index aab0a4f..811cac2 100644 --- a/dev/index.html +++ b/dev/index.html @@ -4,4 +4,4 @@ Pkg.add(url="https://github.com/Alseidon/TaylorInterface.jl")

You also need the taylor tool installed to use this package. You can find it here (latest version) or install it by running:

curl -sS https://web.ma.utexas.edu/repos/deb/taylor.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/taylor.gpg
 echo "deb [signed-by=/usr/share/keyrings/taylor.gpg] http://web.ma.utexas.edu/repos/deb focal main" | sudo tee /etc/apt/sources.list.d/taylor.list
 sudo apt update
-sudo apt install taylor

Now, you might either want to take a look at the quick start or begin with the full introduction, dive into the internal machinery of TaylorInterface.jl, or simply search the full docs.

+sudo apt install taylor

Now, you might either want to take a look at the quick start or begin with the full introduction, dive into the internal machinery of TaylorInterface.jl, or simply search the full docs.

diff --git a/dev/internals/index.html b/dev/internals/index.html index 3c2e66c..1c409f8 100644 --- a/dev/internals/index.html +++ b/dev/internals/index.html @@ -70,4 +70,4 @@ 1: ok, and ti=endtime. -1: not ok, unable to compute step size. double_log underflow/overflow

You can use it directly (it is included in the lib.so), but it requires some initialisation beforehand if jet transport is at play, or if the number type isn't double. taylor defines the InitMyFloat(x) function to initialize any MY_FLOAT variable. For jet transport, you need to call taylor_initialize_jet_library() before using it, and InitJet(x) on your jet variables. You can refer to wrapper.h for an example of the latter case.

The wrapping functions

TaylorInterface.jl adds some convenience functions in the wrapper. First are two simplified versions of taylor_step_auto: tstep and tstep_reverse (respectively when *endtime is positive or negative)

int tstep(MY_FLOAT *ti, MY_FLOAT *x, double log10err, MY_FLOAT *endtime);
 
-int tstep_reverse(MY_FLOAT *ti, MY_FLOAT *x, double log10err, MY_FLOAT *endtime);

They simply hide some of taylor_step_auto's parameters, and regroup log10abserr and log10relerr.

Finally, we include a Poincaré map from 0. to endtime:

void flow(double endtime, MY_FLOAT *x, MY_FLOAT *y, MY_FLOAT *df);

Where x is the initial state, y stores the final state and df stores the non-zero degree jet transport values.

+int tstep_reverse(MY_FLOAT *ti, MY_FLOAT *x, double log10err, MY_FLOAT *endtime);

They simply hide some of taylor_step_auto's parameters, and regroup log10abserr and log10relerr.

Finally, we include a Poincaré map from 0. to endtime:

void flow(double endtime, MY_FLOAT *x, MY_FLOAT *y, MY_FLOAT *df);

Where x is the initial state, y stores the final state and df stores the non-zero degree jet transport values.

diff --git a/dev/introduction/index.html b/dev/introduction/index.html index 9727ad7..1ba41e1 100644 --- a/dev/introduction/index.html +++ b/dev/introduction/index.html @@ -37,4 +37,4 @@ plot(times, positions, label="positions") plot!(times, velocities, label="velocities") xlabel!("\\\$t\\\$") -show()

And thus, you can see nice 2π-periodic oscillations.

+show()

And thus, you can see nice 2π-periodic oscillations.

diff --git a/dev/quickstart/index.html b/dev/quickstart/index.html index a4ac8c9..4b1a57d 100644 --- a/dev/quickstart/index.html +++ b/dev/quickstart/index.html @@ -27,4 +27,4 @@ flow!(handler, in, out, 1., jacobian) # ccall inside -reshape(jacobian, (2, 2))

And finally, we can close our library:

close_lib(handler)

If we don't need the directory anymore, we can delete it:

TaylorInterface.clear_dir(handler) # TaylorInterface.clear_dir(generator) also works

Default models

We propose some default models that come with the package; you can get them with

get_model(modelname)

At the moment, we propose:

Note that you will need to compile the model with compile_eqs(handler) in order to use it.

+reshape(jacobian, (2, 2))

And finally, we can close our library:

close_lib(handler)

If we don't need the directory anymore, we can delete it:

TaylorInterface.clear_dir(handler) # TaylorInterface.clear_dir(generator) also works

Default models

We propose some default models that come with the package; you can get them with

get_model(modelname)

At the moment, we propose:

Note that you will need to compile the model with compile_eqs(handler) in order to use it.

diff --git a/dev/speed/index.html b/dev/speed/index.html index afac5fd..51a406a 100644 --- a/dev/speed/index.html +++ b/dev/speed/index.html @@ -59,4 +59,4 @@ ## Tests @benchmark f_taylor($(u0), $(handler.symbols), $(t_fin)) -@benchmark f_diffeq($(u0), $(f), $(t_fin))

Results

On a AMD Ryzen 7 3700U, f_taylor runs in 184.488 ns ± 92.744 ns, whereas f_diffeq runs in 29.223 μs ± 75.737 μs.

+@benchmark f_diffeq($(u0), $(f), $(t_fin))

Results

On a AMD Ryzen 7 3700U, f_taylor runs in 184.488 ns ± 92.744 ns, whereas f_diffeq runs in 29.223 μs ± 75.737 μs.